-
Notifications
You must be signed in to change notification settings - Fork 346
43 lines (35 loc) · 1.21 KB
/
changeset-enforce.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: No patch level changesets
on:
pull_request
jobs:
check_changesets:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository (feature branch)
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 200
- name: Fetch develop branch
run: |
git fetch origin develop:develop --depth=1
- name: Verify develop branch
run: git branch --all
- uses: pnpm/action-setup@v4
with:
version: 9.12.3
- name: Install changesets
run: pnpm add -g @changesets/[email protected]
- name: Generate changeset status
run: pnpm changeset status --output=changeset-status.json
- name: Check for patch level changesets
run: |
PATCH_CHANGESET_IDS=$(jq -r '.changesets[] | select(.releases[].type == "patch") | .id' changeset-status.json)
if [ -n "$PATCH_CHANGESET_IDS" ]; then
echo "Patch changesets found:"
echo "$PATCH_CHANGESET_IDS"
echo "❌ Patch level changesets are reserved for hotfixes, use major or minor only"
exit 1
else
echo "✅ No patch level changesets found."
fi