Skip to content

Commit 3e2b5b0

Browse files
committed
Add a pipeline delay to PrepareJob for avoiding a race-condition (finding closed PRs).
1 parent 0bbc76e commit 3e2b5b0

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/CompletePipeline.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ on:
152152
jobs:
153153
Prepare:
154154
uses: pyTooling/Actions/.github/workflows/PrepareJob.yml@dev
155+
with:
156+
pipeline-delay: 10
155157

156158
ConfigParams:
157159
uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev

.github/workflows/Parameters.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,18 @@ jobs:
158158
python_jobs: ${{ steps.jobs.outputs.python_jobs }}
159159

160160
steps:
161+
- name: ⌛ Generate a startup delay of ${{ inputs.pipeline-delay }} seconds
162+
id: delay
163+
if: inputs.pipeline-delay >= 0
164+
run: |
165+
sleep ${{ inputs.pipeline-delay }}
166+
161167
- name: ⏬ Checkout repository
162168
uses: actions/checkout@v6
163169
with:
164170
# The command 'git describe' (used for version) needs the history.
165171
fetch-depth: 0
166172

167-
- name: Generate a startup delay of ${{ inputs.pipeline-delay }} seconds
168-
id: delay
169-
if: inputs.pipeline-delay >= 0
170-
run: |
171-
sleep ${{ inputs.pipeline-delay }}
172-
173173
- name: Generate 'python_version'
174174
id: variables
175175
shell: python

.github/workflows/PrepareJob.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ on:
5454
required: false
5555
default: '(v|r)?[0-9]+(\.[0-9]+){0,2}(-(dev|alpha|beta|rc)([0-9]*))?'
5656
type: string
57+
pipeline-delay:
58+
description: 'Slow down this job, to delay the startup of the GitHub Action pipline.'
59+
required: false
60+
default: 0
61+
type: number
5762

5863
outputs:
5964
on_default_branch:
@@ -151,6 +156,12 @@ jobs:
151156
git_submodule_paths: ${{ steps.Classify.outputs.git_submodule_paths }}
152157

153158
steps:
159+
- name: ⌛ Generate a startup delay of ${{ inputs.pipeline-delay }} seconds
160+
id: delay
161+
if: inputs.pipeline-delay >= 0
162+
run: |
163+
sleep ${{ inputs.pipeline-delay }}
164+
154165
- name: ⏬ Checkout repository
155166
uses: actions/checkout@v6
156167
with:

0 commit comments

Comments
 (0)