diff --git a/.github/workflows/changeset-enforce.yml b/.github/workflows/changeset-enforce.yml index b39ab6e7f80..bd6bb201f0f 100644 --- a/.github/workflows/changeset-enforce.yml +++ b/.github/workflows/changeset-enforce.yml @@ -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."