chore(gha): Create self-hosted runner auto-retry action #4
Workflow file for this run
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: Hello World Action | |
on: | |
pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Print Hello World | |
run: | | |
echo "Hello, World!" | |
sleep 20 | |
- name: Print something | |
if: ${{ cancelled() }} | |
run: | | |
# Fetch information about the workflow run | |
echo "fetching current workflow run" | |
API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | |
WORKFLOW_RUN=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $API_URL) | |
# Rerun failed jobs | |
echo "rerunning failed job" | |
RERUN_URL="https://api.github.com/repos/${GITHUB_REPOSITORY_OWNER}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/rerun-failed-jobs" | |
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $RERUN_URL |