Skip to content

Commit

Permalink
Merge pull request #21945 from storybookjs/shilman/danger-patch-label…
Browse files Browse the repository at this point in the history
…-check

Build: Update dangerfile temporarily to check for patch label
  • Loading branch information
shilman authored Apr 5, 2023
2 parents 1b44e67 + e82148f commit 3fb9622
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion scripts/dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import { fail, danger } from 'danger';
import { execSync } from 'child_process';

execSync('npm install lodash');
execSync('npm install lodash ts-dedent');

const flatten = require('lodash/flatten.js');
const intersection = require('lodash/intersection.js');
const isEmpty = require('lodash/isEmpty.js');
const { dedent } = require('ts-dedent');

const pkg = require('../code/package.json'); // eslint-disable-line import/newline-after-import
const prLogConfig = pkg['pr-log'];
Expand All @@ -20,6 +21,23 @@ const Versions = {
const branchVersion = Versions.MINOR;

const checkRequiredLabels = (labels: string[]) => {
if (!labels.includes('patch')) {
fail(dedent`
A 'patch' label is required to merge during stabilization.
Patch PRs are small bug fixes, build updates, and documentation changes.
They do not include new features or more disruptive bugfixes.
These changes will be first released on 7.1-alpha, then patched back to 'main'
after they have been verified to be correct and released as 7.0.x patch releases.
After the stabilization period ends (ETA 2023-04-12), the 'patch' label
will no longer be required to merge into next, and we will merge ALL accepted
PRs to 'next' and release them on 7.1-alpha. Patch PRs will be
patched back to 'main' and released in 7.0.x patch releases.
`);
}

const forbiddenLabels = flatten([
'ci: do not merge',
'in progress',
Expand Down

0 comments on commit 3fb9622

Please sign in to comment.