Skip to content

Commit 6390e8f

Browse files
authored
Merge branch 'lineofflight:main' into main
2 parents 68c7d44 + 54dead6 commit 6390e8f

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/sync-forks.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: Sync Forks
2-
31
on:
42
push:
53
branches:
@@ -9,21 +7,16 @@ jobs:
97
sync-forks:
108
runs-on: ubuntu-latest
119
steps:
12-
- name: Discover and sync forks
13-
env:
10+
- env:
1411
GH_TOKEN: ${{ secrets.ORG_PAT }}
1512
run: |
1613
REPO="${{ github.repository }}"
1714
OWNER="${REPO%/*}"
1815
BASE_REPO="${REPO#*/}"
1916
20-
FORKS=$(gh api repos/$OWNER/$BASE_REPO/forks --paginate |
21-
jq -r ".[] | select(.owner.login == \"$OWNER\") |
22-
.name")
23-
24-
echo "$FORKS" | while read -r fork; do
25-
if [ -n "$fork" ]; then
17+
gh api repos/$OWNER/$BASE_REPO/forks --paginate |
18+
jq -r ".[] | select(.owner.login == \"$OWNER\") | .name" |
19+
while read -r fork; do
2620
echo "Syncing fork: $OWNER/$fork"
2721
gh repo sync $OWNER/$fork --source $OWNER/$BASE_REPO || echo "Failed to sync $OWNER/$fork"
28-
fi
29-
done
22+
done

0 commit comments

Comments
 (0)