Skip to content

Merge branch 'lineofflight:main' into main #4

Merge branch 'lineofflight:main' into main

Merge branch 'lineofflight:main' into main #4

Workflow file for this run

name: Sync Forks
on:
push:
branches:
- main
jobs:
sync-forks:
runs-on: ubuntu-latest
steps:
- name: Discover and sync forks
env:
GH_TOKEN: ${{ secrets.ORG_PAT }}
run: |
REPO="${{ github.repository }}"
OWNER="${REPO%/*}"
BASE_REPO="${REPO#*/}"
FORKS=$(gh api repos/$OWNER/$BASE_REPO/forks --paginate |
jq -r ".[] | select(.owner.login == \"$OWNER\") |
.name")
echo "$FORKS" | while read -r fork; do
if [ -n "$fork" ]; then
echo "Syncing fork: $OWNER/$fork"
gh repo sync $OWNER/$fork --source $OWNER/$BASE_REPO || echo "Failed to sync $OWNER/$fork"
fi
done