-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(update): don't do anything if nothing has changed
- Loading branch information
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|
@@ -39,4 +49,4 @@ jobs: | |
body: "" | ||
branch: chore/cookiecutter-pypackage | ||
delete-branch: true | ||
{% endraw %} | ||
{% endraw %} |