Skip to content

sync-fork

sync-fork #60

Workflow file for this run

name: Sync Fork
on:
repository_dispatch:
types: [sync-fork]
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- name: Sync Fork (Excluding Workflows)
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
# Setup sparse checkout
git remote add upstream https://github.com/iiits/alumni-portal.git
git sparse-checkout set --no-cone '/*' '!.github/workflows'
# Sync while preserving local workflows
git fetch upstream
git checkout main
git merge upstream/main --allow-unrelated-histories
git push origin main