From f388737bced210ebc6b6bc11f5557c312a283abd Mon Sep 17 00:00:00 2001 From: Brendan Ryan Date: Tue, 20 Jan 2026 15:23:42 -0800 Subject: [PATCH] fix: resolve action compatibility and release tag issues 1. action.yml: Replace pnpm/action-setup with corepack - The hardcoded `version: 9` conflicted with projects using pnpm 10+ - pnpm/action-setup@v4 throws when packageManager field conflicts - Using corepack respects the action's own packageManager field 2. release.yml: Create vX.Y.Z tags from changeset tags - Changesets creates tags like @tempoxyz/lints@0.1.1 - release-tags.yml expects vX.Y.Z format to create major version tags - Now creates v0.1.1 tag from @tempoxyz/lints@0.1.1 before releasing - This allows release-tags.yml to properly create/update v0 tag --- .github/workflows/release.yml | 25 +++++++++++++++++-------- action.yml | 9 ++++----- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67626a1..5e9cdcc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,29 +56,38 @@ jobs: - name: Create GitHub Release if: steps.changesets.outputs.published == 'true' run: | - # Get the version from package.json using jq + # Get the version from package.json VERSION=$(jq -r '.version' package.json) TAG="v${VERSION}" + CHANGESET_TAG="@tempoxyz/lints@${VERSION}" - # Wait for tag to be available (changesets creates it asynchronously) - # Total wait time: 20 seconds (10 attempts × 2 seconds) + # Changesets creates tags like @tempoxyz/lints@0.1.1 + # We need to create vX.Y.Z tags for GitHub Actions compatibility + echo "Looking for changeset tag: $CHANGESET_TAG" + + # Wait for changeset tag to be available MAX_ATTEMPTS=10 SLEEP_SECONDS=2 - echo "Waiting for tag $TAG to be available..." for i in $(seq 1 $MAX_ATTEMPTS); do - if git rev-parse "$TAG" >/dev/null 2>&1; then - echo "Tag $TAG found" + git fetch --tags origin + if git rev-parse "$CHANGESET_TAG" >/dev/null 2>&1; then + echo "Changeset tag $CHANGESET_TAG found" break fi if [ $i -eq $MAX_ATTEMPTS ]; then - echo "Error: Tag $TAG not found after waiting ${MAX_ATTEMPTS} attempts ($(($MAX_ATTEMPTS * $SLEEP_SECONDS)) seconds total)" + echo "Error: Tag $CHANGESET_TAG not found after $MAX_ATTEMPTS attempts" exit 1 fi echo "Attempt $i/$MAX_ATTEMPTS: Tag not yet available, waiting..." sleep $SLEEP_SECONDS done - # Create GitHub release using gh CLI + # Create the vX.Y.Z tag pointing to the same commit + echo "Creating tag $TAG from $CHANGESET_TAG" + git tag "$TAG" "$CHANGESET_TAG" + git push origin "$TAG" + + # Create GitHub release using the vX.Y.Z tag gh release create "$TAG" \ --title "$TAG" \ --notes "See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." diff --git a/action.yml b/action.yml index bb9b8e6..11194d4 100644 --- a/action.yml +++ b/action.yml @@ -43,16 +43,15 @@ outputs: runs: using: "composite" steps: - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "20" + - name: Enable corepack + shell: bash + run: corepack enable + - name: Get cache keys id: cache-keys shell: bash