Skip to content
Snippets Groups Projects
Unverified Commit 6a8ee7e6 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Rerun flaky workflows on `master` and `release` branches (#26495)

parent 1535f79c
No related branches found
No related tags found
No related merge requests found
name: Rerun Flaky Workflows
on:
workflow_run:
workflows: [Backend, Driver Tests, E2E Tests, Frontend]
types: [completed]
branches: [master, 'release-**']
jobs:
rerun-on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion }} == 'failure'
steps:
- uses: actions/github-script@v6
with:
script: |
const MAX_ATTEMPTS = 2;
const ATTEMPT = ${{ github.event.workflow_run.run_attempt }};
if (ATTEMPT <= MAX_ATTEMPTS) {
console.log("Rerruning...");
github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
} else {
console.log("Rerunning didn't help!");
console.log("Please check workflow " + ${{ github.event.workflow_run.id }});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment