Skip to content

Commit c7c4f7d

Browse files
authored
Update sync-fork.yml
1 parent 0541e24 commit c7c4f7d

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

.github/workflows/sync-fork.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,44 @@ on:
77
workflow_dispatch: # manual trigger
88

99
jobs:
10-
sync-winget-branch:
10+
sync-master:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout fork
13+
- name: Checkout fork master
1414
uses: actions/checkout@v4
1515
with:
16-
ref: winget-release-workflow
16+
ref: master
1717
token: ${{ secrets.GITHUB_TOKEN }}
1818

19-
- name: Add upstream
19+
- name: Add upstream remote
2020
run: |
2121
git remote add upstream https://github.com/libvips/build-win64-mxe.git || true
2222
git fetch upstream master --tags
2323
24-
- name: Merge upstream master into winget-release-workflow
24+
- name: Hard reset fork master to upstream
2525
run: |
26-
git checkout winget-release-workflow
27-
git merge upstream/master --no-edit || echo "No changes to merge"
26+
git checkout master
27+
git reset --hard upstream/master
28+
git push origin master --force
29+
git push origin --tags
2830
29-
- name: Push updates
31+
sync-winget-branch:
32+
runs-on: ubuntu-latest
33+
needs: sync-master
34+
steps:
35+
- name: Checkout fork branch
36+
uses: actions/checkout@v4
37+
with:
38+
ref: winget-release-workflow
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Add upstream remote
3042
run: |
31-
git push origin winget-release-workflow
32-
git push origin --tags
43+
git remote add upstream https://github.com/libvips/build-win64-mxe.git || true
44+
git fetch upstream master
45+
46+
- name: Rebase winget-release-workflow on upstream/master
47+
run: |
48+
git checkout winget-release-workflow
49+
git rebase upstream/master || (git rebase --abort && exit 1)
50+
git push origin winget-release-workflow --force

0 commit comments

Comments
 (0)