diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c78023d94..ac04254b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} \ No newline at end of file + 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 }} \ No newline at end of file