From 45a2d57034d2e447fc8b3875f5f5a2cd9b3c353f Mon Sep 17 00:00:00 2001 From: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com> Date: Wed, 19 Jun 2024 01:34:29 +0100 Subject: [PATCH] chore(ci): do not enforce changeset entry for certain milestones (#10858) Right now the check will enforce a changeset entry for any PR. We have noticed this can be a bit excessive for the current RSC/SSR work. These features are not scheduled for stable release in the near future and so requiring a changeset on every related PR can produce changesets which are of little value - descriptions of fixes for features that have never been released in stables. --- .github/actions/check_changesets/check_changesets.mjs | 8 ++++++++ .github/workflows/check-changelog.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/actions/check_changesets/check_changesets.mjs b/.github/actions/check_changesets/check_changesets.mjs index d012b019f0d3..334b23bf9455 100644 --- a/.github/actions/check_changesets/check_changesets.mjs +++ b/.github/actions/check_changesets/check_changesets.mjs @@ -11,6 +11,14 @@ async function main() { return } + // We only enforce changesets on PRs that are not marked as "chore" or "SSR" or "RSC" + const skipOnMilestone = ['chore', 'SSR', 'RSC'] + const { milestone } = github.context.payload.pull_request + if (milestone && skipOnMilestone.includes(milestone.title)) { + console.log(`Skipping check because of the "${milestone.title}" milestone`) + return + } + // Check if the PR adds a changeset. await exec('git fetch origin main', [], { silent: true }) const { stdout } = await getExecOutput('git diff origin/main --name-only', [], { silent: true }) diff --git a/.github/workflows/check-changelog.yml b/.github/workflows/check-changelog.yml index b50623f54571..d854c06298c5 100644 --- a/.github/workflows/check-changelog.yml +++ b/.github/workflows/check-changelog.yml @@ -2,7 +2,7 @@ name: 📝 Check changesets on: pull_request: - types: [opened, synchronize, reopened, labeled, unlabeled] + types: [opened, synchronize, reopened, labeled, unlabeled, milestoned, demilestoned] # Cancel in-progress runs of this workflow. # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow.