Skip to content

Commit

Permalink
fix(update): don't do anything if nothing has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
escaped committed Feb 11, 2021
1 parent ca40a65 commit 201e2aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion {{ cookiecutter.project_slug }}/.github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,27 @@ jobs:
- name: Update project structure
run: |
cruft update -y
- name: Check if there are changes
id: changes
uses: UnicornGlobal/[email protected]

- name: apply additional changes and fixes
if: steps.changes.outputs.changed == 1
run: |
poetry lock --no-update # add new dependencies
poetry install
poetry run pre-commit run -a || true # we have to fix other issue manually
- name: Get new template version
if: steps.changes.outputs.changed == 1
# extract new cooiecutter template version
run: |
echo "TEMPLATE_COMMIT=$(cat .cruft.json | jello -r "_['commit'][:8]")" >> $GITHUB_ENV
# behaviour if PR already exists: https://github.com/marketplace/actions/create-pull-request#action-behaviour
- name: Create Pull Request
if: steps.changes.outputs.changed == 1
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.AUTO_UPDATE_GITHUB_TOKEN }}
Expand All @@ -39,4 +49,4 @@ jobs:
body: ""
branch: chore/cookiecutter-pypackage
delete-branch: true
{% endraw %}
{% endraw %}

0 comments on commit 201e2aa

Please sign in to comment.