Skip to content

Commit 7283be5

Browse files
(maint) - Add workflow-restarter to nightly workflow to resart failed jobs
1 parent 4176a35 commit 7283be5

File tree

2 files changed

+23
-109
lines changed

2 files changed

+23
-109
lines changed

.github/workflows/nightly.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,26 @@ jobs:
7575
- name: Run tests
7676
run: |
7777
bundle exec rake spec
78+
79+
on-failure-workflow-restarter-proxy:
80+
# (1) run this job after the "windows_tests" job and...
81+
needs: [windows_tests, linux_tests]
82+
# (2) continue ONLY IF "windows_tests" fails
83+
if: always() && needs.windows_tests.result == 'failure' || needs.linux_tests.result == 'failure'
84+
runs-on: ubuntu-latest
85+
steps:
86+
# (3) checkout this repository in order to "see" the following custom action
87+
- name: Checkout repository
88+
uses: actions/checkout@v4
89+
90+
# (4) "use" the custom action to retrigger the failed "windows_tests job" above
91+
# NOTE: pass the SOURCE_GITHUB_TOKEN to the custom action because (a) it must have
92+
# this to trigger the reusable workflow that restarts the failed job; and
93+
# (b) custom actions do not have access to the calling workflow's secrets
94+
- name: Trigger reusable workflow
95+
uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy@main"
96+
env:
97+
SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
with:
99+
repository: ${{ github.repository }}
100+
run_id: ${{ github.run_id }}

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

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)