File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 1- name : Sync Forks
2-
31on :
42 push :
53 branches :
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
You can’t perform that action at this time.
0 commit comments