File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ name: Weekly Poetry Update
2
2
3
3
on :
4
4
schedule :
5
- # - cron: '0 0 * * 0' # Runs every Sunday at midnight
6
- - cron : ' 0 * * * *' # Runs every hour for testing
5
+ - cron : ' 0 0 * * 0' # Runs every Sunday at midnight
7
6
8
7
jobs :
9
8
update-dependencies :
@@ -30,15 +29,22 @@ jobs:
30
29
run : poetry install
31
30
32
31
- name : Update dependencies
33
- run : poetry update
32
+ run : poetry update | tee poetry-update.log
34
33
35
34
- name : Create new branch
36
35
run : |
37
36
git config --global user.name 'github-actions[bot]'
38
37
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
39
38
git checkout -b update-dependencies-$(date +%Y%m%d)
40
- git add .
41
- git commit -m "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d)"
39
+ git add poetry.lock
40
+ if git diff-index --quiet HEAD; then
41
+ echo "No changes detected, creating an empty commit."
42
+ git commit --allow-empty -m "chore(deps): :arrows_counterclockwise: no updates for $(date +%Y%m%d)"
43
+ else
44
+ echo "Changes detected, creating a commit with update log."
45
+ update_log=$(cat update.log)
46
+ git commit -m "$(echo -e "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d)\n\n$update_log")"
47
+ fi
42
48
git push origin update-dependencies-$(date +%Y%m%d)
43
49
44
50
- name : Create Pull Request
You can’t perform that action at this time.
0 commit comments