Skip to content

Commit 8dd672a

Browse files
authored
Update sync-and-apply-patches.yml
1 parent b1b559d commit 8dd672a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/sync-and-apply-patches.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ run-name: Patch and build ${{ github.event_name == 'schedule' && 'latest upstrea
33

44
on:
55
schedule:
6-
- cron: '0 0 * * *' # Daily at midnight
6+
- cron: '0 0 * * 0' # Weekly at midnight
77
workflow_dispatch:
88
inputs:
99
tag:
1010
description: 'Specify a tag (optional)'
1111
required: false
1212
default: ''
13+
force:
14+
description: 'Force push branch and tag'
15+
required: false
16+
default: 'false'
1317

1418
jobs:
1519
sync-and-patch:
@@ -101,7 +105,7 @@ jobs:
101105
echo "failed_patches=${failed_patches[@]}" >> $GITHUB_ENV
102106
103107
# Push the branch even if only some patches were applied
104-
git push -f https://github.com/${{ github.repository }}.git HEAD
108+
git push https://github.com/${{ github.repository }}.git HEAD ${{ inputs.force == 'true' && '--force' }}
105109
env:
106110
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
107111

@@ -110,7 +114,7 @@ jobs:
110114
run: |
111115
git tag -d "${{ steps.determine-tag.outputs.tag }}" || echo "Tag does not exist locally, skipping delete."
112116
git tag -a "${{ steps.determine-tag.outputs.tag }}" -m "Tagging version ${{ steps.determine-tag.outputs.tag }} after applying patches"
113-
git push origin "${{ steps.determine-tag.outputs.tag }}"
117+
git push origin "${{ steps.determine-tag.outputs.tag }}" ${{ inputs.force == 'true' && '--force' }}
114118
115119
build:
116120
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)