From b750c563ac11a81e80d0a059b0c6330c8ad5ca59 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 27 Aug 2026 13:31:02 -0400 Subject: [PATCH 1/2] feat: skip PR description check for bot-authored PRs Detect bot authors via user.type so required description checks still pass without a caller-level job skip that would leave the status pending. --- .github/scripts/validate-pr-description.js | 18 +++++++++++++----- .../callable.pr-description-check.yaml | 11 ++++++++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/scripts/validate-pr-description.js b/.github/scripts/validate-pr-description.js index 5c05522..8d1427d 100644 --- a/.github/scripts/validate-pr-description.js +++ b/.github/scripts/validate-pr-description.js @@ -2,14 +2,17 @@ * Validate that a PR description has a filled Overview section. * Intended for use with actions/github-script. * + * Bot- and revert-authored PRs are exempt; detection lives here rather than in a + * caller/workflow `if` condition so the job still completes successfully instead of + * showing as skipped, which can block merges when this check is required. + * * @param {{ core: import('@actions/core'), context: import('@actions/github').Context }} params * @param {{ minOverviewLength?: number }} options */ -/** - * Revert PRs are exempt from description validation. Detection lives here rather than - * in a workflow `if` condition so the job still completes successfully instead of - * showing as skipped, which can block merges when this check is required. - */ +function isBotPr(pr) { + return pr?.user?.type === 'Bot'; +} + function isRevertPr(pr) { const title = pr?.title ?? ''; const headRef = pr?.head?.ref ?? ''; @@ -20,6 +23,11 @@ module.exports = async function validatePrDescription({ core, context }, options const minOverviewLength = Number(options.minOverviewLength) || 40; const pr = context.payload.pull_request; + if (isBotPr(pr)) { + core.info('Skipping PR description check for bot-authored PR.'); + return; + } + if (isRevertPr(pr)) { core.info('Skipping PR description check for revert PR.'); return; diff --git a/.github/workflows/callable.pr-description-check.yaml b/.github/workflows/callable.pr-description-check.yaml index c443e37..b9e4de3 100644 --- a/.github/workflows/callable.pr-description-check.yaml +++ b/.github/workflows/callable.pr-description-check.yaml @@ -11,6 +11,15 @@ on: GH_TOKEN: required: true +# The actual use of the workflow should have the following: +#on: +# pull_request: +# types: [opened, edited, reopened] +# +# Bot and revert PRs are handled in validate-pr-description.js so this job still +# passes. Callers must always invoke this workflow — do not add a job-level if on +# the caller, or the required check stays pending for bot-authored PRs. + jobs: pr-description-check: name: PR description check @@ -37,7 +46,7 @@ jobs: const script = require('${{ github.workspace }}/.github/scripts/validate-pr-description.js'); // github, context, and core are injected by github-script from this // job's runtime context (the caller's workflow run / PR payload). - // Revert PRs (title "Revert ..." or revert-* branch) are exempt — see validate-pr-description.js. + // Bot- and revert-authored PRs are exempt — see validate-pr-description.js. await script( { github, context, core }, { minOverviewLength: Number(process.env.MIN_OVERVIEW_LENGTH) } From c662c7cb1174d16fd587b0c8b00b64d6a7687c24 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Mon, 31 Aug 2026 19:29:50 -0400 Subject: [PATCH 2/2] feat: require Overview for allowlisted release bots Jarvis-Alloy, release-orchestrator, release-orchestrator-ai, and argocd-alloy must still pass description validation; other bots stay exempt. --- .github/scripts/validate-pr-description.js | 26 ++++++++++++++++--- .../callable.pr-description-check.yaml | 8 +++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/scripts/validate-pr-description.js b/.github/scripts/validate-pr-description.js index 8d1427d..ae0fdfa 100644 --- a/.github/scripts/validate-pr-description.js +++ b/.github/scripts/validate-pr-description.js @@ -6,11 +6,29 @@ * caller/workflow `if` condition so the job still completes successfully instead of * showing as skipped, which can block merges when this check is required. * + * Bots in BOTS_REQUIRED_TO_VALIDATE are not exempt and must still fill Overview. + * * @param {{ core: import('@actions/core'), context: import('@actions/github').Context }} params * @param {{ minOverviewLength?: number }} options */ -function isBotPr(pr) { - return pr?.user?.type === 'Bot'; + +/** Bot logins that must still pass description validation (case-insensitive; `[bot]` suffix optional). */ +const BOTS_REQUIRED_TO_VALIDATE = [ + 'jarvis-alloy', + 'release-orchestrator', + 'release-orchestrator-ai', + 'argocd-alloy', +]; + +function normalizeBotLogin(login) { + return (login ?? '').toLowerCase().replace(/\[bot\]$/, ''); +} + +function isExemptBotPr(pr) { + if (pr?.user?.type !== 'Bot') { + return false; + } + return !BOTS_REQUIRED_TO_VALIDATE.includes(normalizeBotLogin(pr?.user?.login)); } function isRevertPr(pr) { @@ -23,8 +41,8 @@ module.exports = async function validatePrDescription({ core, context }, options const minOverviewLength = Number(options.minOverviewLength) || 40; const pr = context.payload.pull_request; - if (isBotPr(pr)) { - core.info('Skipping PR description check for bot-authored PR.'); + if (isExemptBotPr(pr)) { + core.info(`Skipping PR description check for bot-authored PR (${pr?.user?.login}).`); return; } diff --git a/.github/workflows/callable.pr-description-check.yaml b/.github/workflows/callable.pr-description-check.yaml index b9e4de3..5dd8350 100644 --- a/.github/workflows/callable.pr-description-check.yaml +++ b/.github/workflows/callable.pr-description-check.yaml @@ -17,8 +17,9 @@ on: # types: [opened, edited, reopened] # # Bot and revert PRs are handled in validate-pr-description.js so this job still -# passes. Callers must always invoke this workflow — do not add a job-level if on -# the caller, or the required check stays pending for bot-authored PRs. +# passes (except allowlisted bots that must still fill Overview). Callers must +# always invoke this workflow — do not add a job-level if on the caller, or the +# required check stays pending for bot-authored PRs. jobs: pr-description-check: @@ -46,7 +47,8 @@ jobs: const script = require('${{ github.workspace }}/.github/scripts/validate-pr-description.js'); // github, context, and core are injected by github-script from this // job's runtime context (the caller's workflow run / PR payload). - // Bot- and revert-authored PRs are exempt — see validate-pr-description.js. + // Most bot- and revert-authored PRs are exempt; allowlisted bots still + // validate — see validate-pr-description.js. await script( { github, context, core }, { minOverviewLength: Number(process.env.MIN_OVERVIEW_LENGTH) }