Skip to content

Commit 595c22a

Browse files
committed
Add option to delay tag push
Since github has issues with triggering all builds when already some are running, this should help to plan ahead to not miss any builds.
1 parent c6d145c commit 595c22a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/upgrade-unity.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ on:
2929
required: false
3030
type: string
3131
default: '-accept-apiupdate'
32+
delayTags:
33+
description: 'Delay before force pushing tags (in minutes)'
34+
required: false
35+
type: number
36+
default: 0
3237

3338
jobs:
3439
upgrade-unity-version:
@@ -45,6 +50,7 @@ jobs:
4550
echo "Only create tags: $TAGS_ONLY"
4651
echo "Merge master into branch: $MERGE_MASTER"
4752
echo "Custom cli arguments: $CUSTOM_PARAMETERS"
53+
echo "Delay tags: $DELAY_TAGS minutes"
4854
if [[ "$BRANCH_NAME" == *"urp"* ]]
4955
then
5056
echo "urp: true"
@@ -57,6 +63,7 @@ jobs:
5763
TAGS_ONLY: ${{ inputs.tagsOnly }}
5864
MERGE_MASTER: ${{ inputs.mergeMaster }}
5965
CUSTOM_PARAMETERS: ${{ inputs.customParameters }}
66+
DELAY_TAGS: ${{ inputs.delayTags }}
6067

6168
- uses: actions/checkout@v4
6269
with:
@@ -195,6 +202,16 @@ jobs:
195202
title: "[Automated workflow] upgrade-unity from ${{steps.last_unity_version.outputs.NAME}} to ${{ steps.upgrade_name.outputs.NAME }}"
196203
body: ${{ steps.template.outputs.result }}
197204

205+
- name: Wait before pushing tags
206+
if: ${{ (inputs.createTags || inputs.tagsOnly) && inputs.delayTags > 0 }}
207+
run: |
208+
DELAY_SECONDS=$((DELAY_TAGS * 60))
209+
echo "Waiting for $DELAY_TAGS minutes ($DELAY_SECONDS seconds) before pushing tags..."
210+
sleep $DELAY_SECONDS
211+
echo "Wait complete. Proceeding with tag push."
212+
env:
213+
DELAY_TAGS: ${{ inputs.delayTags }}
214+
198215
- name: Add tags
199216
if: ${{ inputs.createTags || inputs.tagsOnly }}
200217
run: |

0 commit comments

Comments
 (0)