Skip to content

Commit

Permalink
add composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
danadoherty639 committed Sep 18, 2024
1 parent 19ba173 commit ecf918e
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,25 @@ jobs:
rake_task: 'acceptance:local'
runs_on: ${{ matrix.os }}

rerun:
needs: "acceptance"
if: always() && needs.acceptance.result == 'failure' && github.run_attempt <= '3'
name: "rerun"
uses: "puppetlabs/cat-github-actions/.github/workflows/workflow-restarter.yml@cat_1820"
with:
repo: ${{ github.repository }}
run_id: ${{ github.run_id }}
on-failure-workflow-restarter-proxy:
# (1) run this job after the "acceptance" job and...
needs: [acceptance]
# (2) continue ONLY IF "acceptance" fails
if: always() && 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 "acceptance 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/action.yml@cat_1820"
env:
SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repository: ${{ github.repository }}
run_id: ${{ github.run_id }}

0 comments on commit ecf918e

Please sign in to comment.