Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 2cfb79e

Browse files
authored
Force push to each branch
1 parent df75282 commit 2cfb79e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/sync.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@ on:
88
- 'icons/**'
99
- 'json/**'
1010
workflow_dispatch:
11+
1112
jobs:
1213
clean_and_move_images:
1314
runs-on: ubuntu-latest
1415
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.modified, 'icons') }}
16+
1517
steps:
1618
- name: Checkout repository
1719
uses: actions/checkout@v3
1820
with:
1921
fetch-depth: 0
2022

21-
- name: Switch to "Images" branch
23+
- name: Switch to "Images" branch and hard reset to main
2224
run: |
2325
git fetch origin Images
2426
git checkout Images
25-
git reset --hard origin/main # Hard reset to main
26-
git pull origin Images # Pull the latest changes from the Images branch
27+
git reset --hard origin/main
2728
2829
- name: Delete everything except /icons/
2930
run: |
@@ -43,24 +44,22 @@ jobs:
4344
4445
- name: Push changes to Images branch
4546
run: |
46-
git push origin Images
47+
git push origin Images --force
4748
4849
clean_and_move_json:
4950
runs-on: ubuntu-latest
5051
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.modified, 'json') }}
51-
5252
steps:
5353
- name: Checkout repository
5454
uses: actions/checkout@v3
5555
with:
5656
fetch-depth: 0
5757

58-
- name: Switch to "JSON" branch
58+
- name: Switch to "JSON" branch and hard reset to main
5959
run: |
6060
git fetch origin JSON
6161
git checkout JSON
62-
git reset --hard origin/main # Hard reset to main
63-
git pull origin JSON # Pull the latest changes from the JSON branch
62+
git reset --hard origin/main
6463
6564
- name: Delete everything except /json/
6665
run: |
@@ -80,4 +79,4 @@ jobs:
8079
8180
- name: Push changes to JSON branch
8281
run: |
83-
git push origin JSON
82+
git push origin JSON --force

0 commit comments

Comments
 (0)