Skip to content

Commit 0d662ac

Browse files
authored
fix: 💚 Update GitHub Actions workflow to use 'gh pr merge' command (#1528)
* fix: 💚 Fix change weekly update * fix: 💚 Update GitHub Actions workflow to use 'gh pr merge' command
1 parent ced5e88 commit 0d662ac

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

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

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

33
on:
44
schedule:
5-
- cron: '0 0 * * 0' # Runs every Sunday at midnight
5+
# - cron: '0 0 * * 0' # Runs every Sunday at midnight
6+
- cron: '0 * * * *' # Runs every hour for testing purposes
67

78
jobs:
89
update-dependencies:
@@ -29,7 +30,7 @@ jobs:
2930
run: |
3031
git config --global user.name 'github-actions[bot]'
3132
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32-
git checkout -b update-dependencies-$(date +%Y%m%d)
33+
git checkout -b update-dependencies-$(date +%Y%m%d%H%M)
3334
3435
- name: Install dependencies
3536
run: poetry install
@@ -42,32 +43,32 @@ jobs:
4243
git add poetry.lock
4344
if git diff-index --quiet HEAD; then
4445
echo "No changes detected, creating an empty commit."
45-
git commit --allow-empty -m "chore(deps): :arrows_counterclockwise: no updates for $(date +%Y%m%d)"
46+
git commit --allow-empty -m "chore(deps): :arrows_counterclockwise: no updates for $(date +%Y%m%d%H%M)"
4647
else
4748
echo "Changes detected, creating a commit with update log."
4849
if [ -f poetry-update.log ]; then
4950
update_log=$(cat poetry-update.log)
5051
else
5152
update_log="No update log available."
5253
fi
53-
git commit -m "$(echo -e "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d)\n\n$update_log")"
54+
git commit -m "$(echo -e "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d%H%M)\n\n$update_log")"
5455
fi
5556
5657
- name: Push changes
5758
run: |
58-
git push -f origin update-dependencies-$(date +%Y%m%d)
59+
git push -f origin update-dependencies-$(date +%Y%m%d%H%M)
5960
6061
- name: Create Pull Request via gh
6162
run: |
62-
gh pr create --title "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d)" \
63+
gh pr create --title "chore(deps): :arrows_counterclockwise: update dependencies $(date +%Y%m%d%H%M)" \
6364
--body "This is an auto-generated pull request to update dependencies in poetry.lock." \
6465
--base main \
65-
--head update-dependencies-$(date +%Y%m%d)
66+
--head update-dependencies-$(date +%Y%m%d%H%M)
6667
env:
6768
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6869

69-
- name: Set Auto PR
70+
- name: Merge Pull Request via gh
7071
run: |
71-
gh pr merge update-dependencies-$(date +%Y%m%d) --auto --rebase
72+
gh pr merge update-dependencies-$(date +%Y%m%d%H%M) --merge --auto
7273
env:
7374
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)