Skip to content

Commit

Permalink
temp: get patch versions via changeset status JSON output
Browse files Browse the repository at this point in the history
  • Loading branch information
angusbayley committed Oct 31, 2024
1 parent 06dd4fd commit 06de82c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/changeset-enforce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,25 @@ jobs:
with:
ref: ${{ github.head_ref }}
fetch-depth: 1
sparse-checkout: |
.changeset

- uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Install changesets
# run: pnpm install -w @changesets/cli --no-frozen-lockfile
run: pnpm add -g @changesets/cli

- name: Generate changeset status
run: pnpm changeset status --output=changeset-status.json

- name: Check for patch level changesets
run: |
if grep -r ": patch" .changeset/*.md; then
echo "❌ Patch level changesets are reserved for hotfixes, use major or minor only."
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."
Expand Down

0 comments on commit 06de82c

Please sign in to comment.