Skip to content

Commit 9098220

Browse files
(CAT-2092) - Add workflow restarter
1 parent 29f141c commit 9098220

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,22 @@ jobs:
7777
- name: Run tests
7878
run: |
7979
bundle exec rake spec
80+
81+
on-failure-workflow-restarter-proxy:
82+
# (1) run this job after the "acceptance" job and...
83+
needs: [linux_tests, windows_tests]
84+
# (2) continue ONLY IF "acceptance" fails
85+
if: always() && needs.linux_tests.result == 'failure' || needs.windows_tests.result == 'failure'
86+
runs-on: ubuntu-latest
87+
steps:
88+
# (3) checkout this repository in order to "see" the following custom action
89+
- name: Checkout repository
90+
uses: actions/checkout@v4
91+
92+
- name: Trigger reusable workflow
93+
uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy"
94+
env:
95+
SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
with:
97+
repository: ${{ github.repository }}
98+
run_id: ${{ github.run_id }}

.github/workflows/nightly.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,23 @@ 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 "acceptance" job and...
81+
needs: [linux_tests, windows_tests]
82+
# (2) continue ONLY IF "acceptance" fails
83+
if: always() && needs.linux_tests.result == 'failure' || needs.windows_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+
- name: Trigger reusable workflow
91+
uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy"
92+
env:
93+
SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
with:
95+
repository: ${{ github.repository }}
96+
run_id: ${{ github.run_id }}
97+

0 commit comments

Comments
 (0)