Skip to content

ci(coverage): disable jacoco PR comments, relax overall delta threshold to 0.4% #53

ci(coverage): disable jacoco PR comments, relax overall delta threshold to 0.4%

ci(coverage): disable jacoco PR comments, relax overall delta threshold to 0.4% #53

Workflow file for this run

name: Cancel PR Workflows on Close
on:
pull_request:
types: [ closed ]
permissions:
actions: write
jobs:
cancel:
name: Cancel In-Progress Workflows
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
steps:
- name: Cancel PR Build and System Test
uses: actions/github-script@v8
with:
script: |
const workflows = ['pr-build.yml', 'system-test.yml', 'codeql.yml'];
const headSha = context.payload.pull_request.head.sha;
const prNumber = context.payload.pull_request.number;
for (const workflowId of workflows) {
for (const status of ['in_progress', 'queued']) {
const runs = await github.paginate(
github.rest.actions.listWorkflowRuns,
{
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: workflowId,
status,
event: 'pull_request',
per_page: 100,
},
(response) => response.data.workflow_runs
);
for (const run of runs) {
if (!run) {
continue;
}
const prs = Array.isArray(run.pull_requests) ? run.pull_requests : [];
const isTargetPr = prs.length === 0 || prs.some((pr) => pr.number === prNumber);
if (run.head_sha === headSha && isTargetPr) {
await github.rest.actions.cancelWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: run.id,
});
console.log(`Cancelled ${workflowId} run #${run.id} (${status})`);
}
}
}
}