Add bypass-fastfail label for check-stage-health (#24577)

This commit is contained in:
Liangsheng Yin
2026-05-06 21:34:06 -07:00
committed by GitHub
parent 9ba4aac47b
commit 8bb0ce192b
+21 -1
View File
@@ -1,5 +1,5 @@
name: Check Stage Health name: Check Stage Health
description: Fail fast if any job in the current workflow run has already failed, or if the lint check (from lint.yml) has failed. Auto-skips for scheduled runs. description: Fail fast if any job in the current workflow run has already failed, or if the lint check (from lint.yml) has failed. Auto-skips for scheduled runs. The jobs-failed check (but not the lint check) is bypassed when the PR carries the `bypass-fastfail` label.
inputs: inputs:
github-token: github-token:
@@ -47,6 +47,26 @@ runs:
return; return;
} }
// Skip the jobs-failed check when the PR carries the bypass-fastfail label.
// Lint check above still runs.
let labels = [];
if (context.payload.pull_request?.labels) {
labels = context.payload.pull_request.labels.map(l => l.name);
} else {
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: ref,
});
if (prs.length > 0) {
labels = prs[0].labels.map(l => l.name);
}
}
if (labels.includes('bypass-fastfail')) {
core.info('Skipping jobs-failed check (bypass-fastfail label present)');
return;
}
const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, { const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, {
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,