Skip to content

Commit

Permalink
Merge pull request #222 from puppetlabs/maint-cat-2090
Browse files Browse the repository at this point in the history
Add on-failure job to nightly workflow and test with the workflow-res…
  • Loading branch information
gavindidrichsen authored Oct 22, 2024
2 parents 587ca96 + 348b1f6 commit 167ab94
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 63 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,26 @@ jobs:
secrets: "inherit"
with:
ruby_version: ${{ matrix.ruby_version }}

on-failure-workflow-restarter-proxy:
# (1) run this job after the "spec" job and...
needs: [spec, acceptance]
# (2) continue ONLY IF "spec" fails
if: always() && needs.spec.result == 'failure' || needs.acceptance.result == 'failure'
runs-on: ubuntu-latest
steps:
# (3) checkout this repository in order to "see" the following custom action
- name: Checkout repository
uses: actions/checkout@v4

# (4) "use" the custom action to retrigger the failed "spec job" above
# NOTE: pass the SOURCE_GITHUB_TOKEN to the custom action because (a) it must have
# this to trigger the reusable workflow that restarts the failed job; and
# (b) custom actions do not have access to the calling workflow's secrets
- name: Trigger reusable workflow
uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy@main"
env:
SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repository: ${{ github.repository }}
run_id: ${{ github.run_id }}
63 changes: 0 additions & 63 deletions .github/workflows/workflow-restarter-test.yml

This file was deleted.

0 comments on commit 167ab94

Please sign in to comment.