Skip to content

Commit 167ab94

Browse files
Merge pull request #222 from puppetlabs/maint-cat-2090
Add on-failure job to nightly workflow and test with the workflow-res…
2 parents 587ca96 + 348b1f6 commit 167ab94

File tree

2 files changed

+23
-63
lines changed

2 files changed

+23
-63
lines changed

.github/workflows/nightly.yml

+23
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,26 @@ jobs:
3535
secrets: "inherit"
3636
with:
3737
ruby_version: ${{ matrix.ruby_version }}
38+
39+
on-failure-workflow-restarter-proxy:
40+
# (1) run this job after the "spec" job and...
41+
needs: [spec, acceptance]
42+
# (2) continue ONLY IF "spec" fails
43+
if: always() && needs.spec.result == 'failure' || needs.acceptance.result == 'failure'
44+
runs-on: ubuntu-latest
45+
steps:
46+
# (3) checkout this repository in order to "see" the following custom action
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
50+
# (4) "use" the custom action to retrigger the failed "spec job" above
51+
# NOTE: pass the SOURCE_GITHUB_TOKEN to the custom action because (a) it must have
52+
# this to trigger the reusable workflow that restarts the failed job; and
53+
# (b) custom actions do not have access to the calling workflow's secrets
54+
- name: Trigger reusable workflow
55+
uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy@main"
56+
env:
57+
SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
with:
59+
repository: ${{ github.repository }}
60+
run_id: ${{ github.run_id }}

.github/workflows/workflow-restarter-test.yml

-63
This file was deleted.

0 commit comments

Comments
 (0)