File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454 # See: https://github.com/changesets/changesets/blob/main/docs/automating-changesets.md#blocking
5555 - name : Run Changesets
5656 run : pnpm changeset status --since origin/main
57+
58+ disallow-major :
59+ - name : Disallow Major Release
60+ runs-on : ubuntu-latest
61+
62+ permissions :
63+ contents : read
64+
65+ # Skip opted out PRs, and release PRs
66+ if : |
67+ ! contains(github.event.pull_request.labels.*.name, 'skip changelog') &&
68+ ! (github.event.pull_request.title == 'chore(release): publish' && github.event.pull_request.user.login == 'github-actions[bot]')
69+
70+ steps :
71+ - name : Checkout source code
72+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
73+ with :
74+ fetch-depth : 0
75+ persist-credentials : false
76+
77+ - name : Check for Major Changeset
78+ run : |
79+ STATUS_OUTPUT=$(pnpm changeset status --since origin/main)
80+ MAJOR_PATTERN="info Packages to be bumped at major:"
81+
82+ if [[ "$STATUS_OUTPUT" == *"$MAJOR_PATTERN"* ]]; then
83+ echo "Error: Major changesets are not allowed. Did you mean to create a minor or patch changeset instead?";
84+ exit 1;
85+ fi
You can’t perform that action at this time.
0 commit comments