Skip to content

Commit 66dc2ee

Browse files
authored
Merge pull request #1487 from Anselmoo/feature/updat-via-empty
feat: ⚡ Allows also empty commits
2 parents 0152b5c + 23e074e commit 66dc2ee

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/weekly-poetry-bot.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Weekly Poetry Update
22

33
on:
44
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
76

87
jobs:
98
update-dependencies:
@@ -30,15 +29,22 @@ jobs:
3029
run: poetry install
3130

3231
- name: Update dependencies
33-
run: poetry update
32+
run: poetry update | tee poetry-update.log
3433

3534
- name: Create new branch
3635
run: |
3736
git config --global user.name 'github-actions[bot]'
3837
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
3938
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
4248
git push origin update-dependencies-$(date +%Y%m%d)
4349
4450
- name: Create Pull Request

0 commit comments

Comments
 (0)