diff --git a/.github/workflows/close-stale-wrong-branch.yml b/.github/workflows/close-stale-wrong-branch.yml index 10b9cd1f..0e907731 100644 --- a/.github/workflows/close-stale-wrong-branch.yml +++ b/.github/workflows/close-stale-wrong-branch.yml @@ -26,6 +26,9 @@ jobs: const twentyFourHoursAgo = new Date(Date.now() - 24 * 60 * 60 * 1000); for (const pull of pulls) { + const hasBypass = pull.labels.some(l => l.name === 'bypass-branch-check'); + if (hasBypass) continue; + const hasLabel = pull.labels.some(l => l.name === 'wrong-base-branch'); if (!hasLabel) continue; diff --git a/.github/workflows/enforce-target-branch.yml b/.github/workflows/enforce-target-branch.yml index 7a326a3f..150cb646 100644 --- a/.github/workflows/enforce-target-branch.yml +++ b/.github/workflows/enforce-target-branch.yml @@ -21,6 +21,12 @@ jobs: const labels = context.payload.pull_request.labels.map(l => l.name); const prNumber = context.payload.pull_request.number; + // bypass-branch-check label skips all enforcement + if (labels.includes('bypass-branch-check')) { + console.log('bypass-branch-check label present, skipping enforcement.'); + return; + } + // If the base was fixed, remove the label and let it through if (base !== 'main') { if (labels.includes('wrong-base-branch')) {