chore: release 11.35.0 #1778
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: E2E Cancel | |
on: | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
cancel: | |
if: ${{ github.event.label.name == 'skip e2e' }} | |
runs-on: ubuntu-latest | |
steps: | |
# Avoid race conditions where the e2e job and this job both kick off at the same time. | |
- name: Pause | |
run: sleep 10 | |
- name: Cancel | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const { data: runs } = await github.request('GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs', { | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
workflow_id: 'e2e.yml', | |
head_sha: context.payload.pull_request.head.sha, | |
headers: { | |
'X-GitHub-Api-Version': '2022-11-28' | |
} | |
}); | |
if (runs[0] && ['in_progress', 'pending', 'queued', 'requested', 'waiting'].includes(runs[0].status)) { | |
core.info(`Cancelling run ${runs[0].id}`); | |
await github.request('POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel', { | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
run_id: runs[0].id, | |
headers: { | |
'X-GitHub-Api-Version': '2022-11-28' | |
} | |
}); | |
} else { | |
core.info('Nothing found to cancel'); | |
} |