Download next.js/.github/workflows/retry_test.yml from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 2.2 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/.github/workflows/retry_test.yml
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/.github/workflows/retry_test.yml
-
curl -L -o retry_test.yml https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/.github/workflows/retry_test.yml
2.2 kB
| name: retry-tests | |
| on: | |
| workflow_run: | |
| workflows: ['build-and-test', 'build-and-deploy'] | |
| branches: [canary] | |
| types: | |
| - completed | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_CANARY_SLACK_WEBHOOK_URL }} | |
| permissions: | |
| actions: write | |
| jobs: | |
| retry-on-failure: | |
| name: retry failed jobs | |
| # Retry the build-and-test workflow up to 3 times | |
| if: >- | |
| ${{ | |
| github.event.workflow_run.conclusion == 'failure' && | |
| github.repository == 'vercel/next.js' && | |
| github.event.workflow_run.run_attempt < 3 | |
| }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: send retry request to GitHub API | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh api \ | |
| --method POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| /repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/rerun-failed-jobs | |
| report-failure: | |
| name: report failure to slack | |
| # Report the failure to Slack if the build-and-test workflow has failed 3 times | |
| # build-and-deploy is not retried so we always report it | |
| if: >- | |
| ${{ | |
| github.event.workflow_run.conclusion == 'failure' && | |
| github.event.workflow_run.run_attempt >= 3 && | |
| !github.event.workflow_run.head_repository.fork | |
| }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: send webhook | |
| uses: slackapi/slack-github-action@v1.25.0 | |
| with: | |
| # These urls are intentionally missing the protocol, | |
| # allowing them to be transformed into actual links in the Slack workflow | |
| # (through slightly hacky means). | |
| payload: | | |
| { | |
| "commit_title": ${{ toJSON(github.event.workflow_run.display_title) }}, | |
| "commit_url": "github.com/${{ github.repository }}/commit/${{ github.event.workflow_run.head_sha }}", | |
| "workflow_run_url": "github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/attempts/${{ github.event.workflow_run.run_attempt }}" | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ env.SLACK_WEBHOOK_URL }} | |