diff --git a/.github/workflows/rerun-test.yml b/.github/workflows/rerun-test.yml deleted file mode 100644 index 8db0450..0000000 --- a/.github/workflows/rerun-test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: rerun-test - -on: - workflow_dispatch: - workflow_run: - workflows: ["test"] - types: [completed] - -jobs: - retry: - runs-on: ubuntu-22.04 - if: ${{ github.event.workflow_run.conclusion == 'failure' }} - steps: - - uses: actions/checkout@v2 - - name: Rerun workflow - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh run rerun $(gh run list -w test.yml | grep -oE '[0-9]{10}' | head -n 1) \ No newline at end of file diff --git a/.github/workflows/rerun.yml b/.github/workflows/rerun.yml new file mode 100644 index 0000000..ea92e18 --- /dev/null +++ b/.github/workflows/rerun.yml @@ -0,0 +1,18 @@ +name: rerun-test + +on: + workflow_run: + workflows: [test] + types: [completed] + +jobs: + on-success: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - run: echo 'The triggering workflow passed' + on-failure: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - run: echo 'The triggering workflow failed'