File tree Expand file tree Collapse file tree 1 file changed +7
-35
lines changed
Expand file tree Collapse file tree 1 file changed +7
-35
lines changed Original file line number Diff line number Diff line change 1- name : Sync Upstream (PR-based, fork-safe )
1+ name : Sync Upstream (PR-based)
22
33on :
44 schedule :
88permissions :
99 contents : write
1010 pull-requests : write
11+ workflows : write
1112
1213jobs :
1314 sync :
1415 runs-on : ubuntu-latest
1516
1617 steps :
17- - name : Checkout fork
18- uses : actions/checkout@v4
18+ - uses : actions/checkout@v4
1919 with :
2020 fetch-depth : 0
2121
22- - name : Configure git
23- run : |
22+ - run : |
2423 git config user.name "github-actions[bot]"
2524 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
2625
27- - name : Add upstream
28- run : |
26+ - run : |
2927 git remote add upstream https://github.com/github/docs.git || true
3028 git fetch upstream
31-
32- - name : Create sync branch from upstream
33- run : |
3429 git checkout -B upstream-sync upstream/main
35-
36- # 🚫 CRITICAL FIX: remove workflows from the index ONLY
37- - name : Exclude upstream workflows from fork
38- run : |
39- git rm -r --cached .github/workflows || true
40-
41- - name : Commit sanitized upstream changes
42- run : |
43- git add .
44- git commit -m "Sync upstream (exclude workflows)" || echo "No changes"
45-
46- - name : Push sync branch
47- run : |
4830 git push origin upstream-sync --force
4931
50- - name : Create or update PR
51- uses : peter-evans/create-pull-request@v6
32+ - uses : peter-evans/create-pull-request@v6
5233 with :
5334 branch : upstream-sync
5435 base : main
5536 title : " ⬆️ Sync with upstream (github/docs)"
56- body : |
57- Automated upstream sync PR.
58-
59- - Fork-safe
60- - Upstream workflows excluded
61- - Runs every 5 minutes
62- labels : |
63- upstream-sync
64- automated
65- delete-branch : false
37+ body : Automated upstream sync
You can’t perform that action at this time.
0 commit comments