Skip to content

Commit

Permalink
fix: create a issue when template needs to be updated (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
12rambau authored Sep 11, 2023
2 parents ab4fd35 + 3c095e9 commit 97b5d65
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 41 deletions.
23 changes: 19 additions & 4 deletions package/.github/workflows/pypackage_check.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,24 @@ jobs:
RELEASE=$(yq -r "._commit" .copier-answers.yml)
echo "current=$RELEASE" >> $GITHUB_OUTPUT
echo "current release: $RELEASE"
- name: call dispatch
- name: open issue
if: steps.get_current_version.outputs.current != steps.get_latest_release.outputs.latest
uses: benc-uk/workflow-dispatch@v1
uses: rishabhgupta/git-action-issue@v2
with:
workflow: pypackage_update.yaml
inputs: {% raw -%}'{"version": "${{ steps.get_latest_release.outputs.latest }}" }'{% endraw %}
token: {% raw -%}${{ secrets.GITHUB_TOKEN }}{% endraw %}
title: "Update template to {% raw -%}${{ steps.get_latest_release.outputs.latest }}{% endraw -%}"
{% raw -%}body: |
The package is based on the ${{ steps.get_cuurent_version.outputs.current }} version of [@12rambau/pypackage](https://github.com/12rambau/pypackage).

The latest version of the template is ${{ steps.get_latest_release.outputs.latest }}.

Please consider updating the template to the latest version to include all the latest developments.

Run the following in your project directory to update the template:

```
copier --trust --defaults --vsc-ref ${{ steps.get_latest_release.outputs.latest }} update
```

Then solve merging issues and push back the changes to your main branch.
{% endraw %}
36 changes: 0 additions & 36 deletions package/.github/workflows/pypackage_update.yaml.jinja

This file was deleted.

1 change: 0 additions & 1 deletion tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def test_build_yaml(copie: Copie) -> None:
_ = yaml.safe_load((workflows_path/"unit.yaml").read_text())
_ = yaml.safe_load((workflows_path/"release.yaml").read_text())
_ = yaml.safe_load((workflows_path/"pypackage_check.yaml").read_text())
_ = yaml.safe_load((workflows_path/"pypackage_update.yaml").read_text())


def test_stub_file(copie: Copie, file_regression) -> None:
Expand Down

0 comments on commit 97b5d65

Please sign in to comment.