File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # .github/workflows/sync.yml
2+ name : Sync from Upstream
3+
4+ on :
5+ schedule :
6+ - cron : ' 0 * * * *' # every hour, adjust as needed
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : write
11+
12+ jobs :
13+ sync :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - uses : actions/checkout@v4
17+ with :
18+ token : ${{ secrets.GITHUB_TOKEN }}
19+ fetch-depth : 0
20+
21+ - name : Add upstream and sync
22+ run : |
23+ git remote add upstream https://git.code.sf.net/p/maxima/website
24+ git fetch upstream
25+
26+ # Save the workflow file before syncing
27+ cp .github/workflows/sync.yml /tmp/sync.yml
28+
29+ # Sync all branches
30+ git push origin refs/remotes/upstream/*:refs/heads/* --force-with-lease
31+ git push origin --tags --force
32+
33+ # Restore the workflow file to master
34+ git checkout master
35+ git reset --hard upstream/master
36+ mkdir -p .github/workflows
37+ cp /tmp/sync.yml .github/workflows/sync.yml
38+ git add .github/workflows/sync.yml
39+ git commit -m "Restore sync workflow" --allow-empty
40+ git push origin master
You can’t perform that action at this time.
0 commit comments