Skip to content

Commit 16ba739

Browse files
authored
Fix workflow to work with branch protection rules (#49)
- Change workflow to create PRs instead of pushing directly to main - Reduce cron schedule from hourly to daily for resource efficiency - Use peter-evans/create-pull-request action to respect branch protection This resolves the repository rule violation where the automated workflow was blocked from pushing directly to main.
1 parent e9ea709 commit 16ba739

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/update-submodule.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Update Archives Submodule and Trigger Pages Build
22

33
on:
44
schedule:
5-
- cron: '0 * * * *' # every hour
5+
- cron: '0 0 * * *' # daily at midnight UTC
66
workflow_dispatch:
77

88
jobs:
@@ -23,9 +23,17 @@ jobs:
2323
- name: Update 'archives' submodule
2424
run: |
2525
git submodule update --remote archives
26-
git add archives
27-
git commit -m "Auto-update archives submodule to latest master" || echo "No changes to commit"
2826
29-
- name: Push changes if any
30-
run: |
31-
git push || echo "Nothing to push"
27+
- name: Create Pull Request
28+
uses: peter-evans/create-pull-request@v5
29+
with:
30+
commit-message: "Auto-update archives submodule to latest master"
31+
title: "Auto-update archives submodule"
32+
body: |
33+
Automated update of the archives submodule to the latest commit.
34+
35+
🤖 This PR was created automatically by the scheduled workflow.
36+
branch: auto-update-archives
37+
delete-branch: true
38+
add-paths: |
39+
archives

0 commit comments

Comments
 (0)