Skip to content

Stable/v0 0 1

Stable/v0 0 1 #4

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