Rerun Flaky Tests #2397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rerun Flaky Tests | |
on: | |
workflow_run: | |
workflows: ["CI Pipeline", "CI Security"] | |
types: | |
- completed | |
jobs: | |
rerun_flaky_tests: | |
name: Rerun Flaky Tests | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt < 5 }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate App Token | |
id: app-token-generation | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Rerun flaky tests | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ steps.app-token-generation.outputs.token }} | |
script: | | |
const { rerunFlakyTests } = await import('${{ github.workspace }}/.github/workflows/scripts/rerunFlakyTests.js') | |
await rerunFlakyTests({ github, context }) |