Stable/v0 0 1 #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: Manage runners | |
on: [ push, pull_request ] | |
jobs: | |
manage-jobs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel self-hosted job | |
run: | | |
# Get the ID of the running job | |
JOB_ID=$(gh api repos/zenflux/zenflux/actions/runs --jq '.workflow_runs[] | select(.status == "queued" and .path == ".github/workflows/0-main-self-hosted.yml") | .id' | head -1) | |
# Cancel the job | |
if [ -n "$JOB_ID" ]; then | |
gh run cancel $JOB_ID | |
else | |
echo "No queued runs to cancel" | |
fi | |
- name: Run github-hosted job | |
run: gh workflow run 1-main-github-hosted.yml |