From 8bb0ce192b7ec61dc4add192d2772c127f0f5e9b Mon Sep 17 00:00:00 2001 From: Liangsheng Yin Date: Wed, 6 May 2026 21:34:06 -0700 Subject: [PATCH] Add bypass-fastfail label for check-stage-health (#24577) --- .github/actions/check-stage-health/action.yml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/actions/check-stage-health/action.yml b/.github/actions/check-stage-health/action.yml index 8fbf44d17..290d3c73e 100644 --- a/.github/actions/check-stage-health/action.yml +++ b/.github/actions/check-stage-health/action.yml @@ -1,5 +1,5 @@ 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: github-token: @@ -47,6 +47,26 @@ runs: 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, { owner: context.repo.owner, repo: context.repo.repo,