Skip to content

Commit 5cdd17e

Browse files
authored
Update sync upstream workflow to exclude workflows
1 parent e9c2939 commit 5cdd17e

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/sync-upstream-pr.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Sync Upstream (PR-based, fork-safe)
22

33
on:
44
schedule:
5-
- cron: "*/5 * * * *" # every 5 minutes
5+
- cron: "*/5 * * * *"
66
workflow_dispatch:
77

88
permissions:
@@ -33,17 +33,15 @@ jobs:
3333
run: |
3434
git checkout -B upstream-sync upstream/main
3535
36-
# 🚫 HARD BLOCK: never allow workflow files from upstream
37-
- name: Remove upstream workflows (fork-safe)
36+
# 🚫 CRITICAL FIX: remove workflows from the index ONLY
37+
- name: Exclude upstream workflows from fork
3838
run: |
39-
rm -rf .github/workflows
40-
mkdir -p .github/workflows
41-
echo "# Fork-safe workflows only" > .github/workflows/.keep
39+
git rm -r --cached .github/workflows || true
4240
4341
- name: Commit sanitized upstream changes
4442
run: |
4543
git add .
46-
git commit -m "Sync upstream (workflows stripped)" || echo "No changes"
44+
git commit -m "Sync upstream (exclude workflows)" || echo "No changes"
4745
4846
- name: Push sync branch
4947
run: |
@@ -58,9 +56,9 @@ jobs:
5856
body: |
5957
Automated upstream sync PR.
6058
61-
Fork-safe
62-
🚫 Upstream workflows stripped
63-
🔁 Runs every 5 minutes
59+
- Fork-safe
60+
- Upstream workflows excluded
61+
- Runs every 5 minutes
6462
labels: |
6563
upstream-sync
6664
automated

0 commit comments

Comments
 (0)