Skip to content

Commit ead3437

Browse files
committed
add check that there are any changed files
1 parent 679c4e8 commit ead3437

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/Update-Poetry-Lock.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Update Poetry lock on a regular basis
22

33
on:
44
schedule:
5-
- cron: '0 4 * * 0' # weekly at 04:00 on Sunday -> https://crontab.guru/#0_4_*_*_0
5+
- cron: "0 4 * * 0" # weekly at 04:00 on Sunday -> https://crontab.guru/#0_4_*_*_0
66
workflow_dispatch:
77

88
env:
99
# Versions are also listed in PR.yml
1010
POETRY_VERSION: 1.2.2
11-
PYTHON_VERSION: 3.9 # Use latest
11+
PYTHON_VERSION: 3.9 # Use latest
1212

1313
jobs:
1414
org-check:
@@ -56,7 +56,17 @@ jobs:
5656
git push --force --set-upstream origin ${{ steps.vars.outputs.branch_name }}
5757
# based on https://stackoverflow.com/a/73340290/8100990
5858
- name: Create Pull Request
59-
run: |
59+
run: |
60+
echo "Changed files:"
61+
git diff --name-only HEAD origin/main --exit-code
62+
63+
if [[ $? ]]; then
64+
echo "Changes detected, creating PR"
65+
else
66+
echo "No changes detected, exiting"
67+
exit 0
68+
fi
69+
6070
gh pr create -B main -H ${{ steps.vars.outputs.branch_name }} --title 'Update poetry lock and reformat' --body '# Update Poetry Lock
6171
6272
Ran:

0 commit comments

Comments
 (0)