From 93135d7707b9e084c18bd98a7795143e3f63361c Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Sun, 12 Apr 2026 02:46:41 -0700 Subject: [PATCH] fix: gate release workflows on full metadata sync --- .github/workflows/release.yml | 11 +++++++---- .github/workflows/reusable-release.yml | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cea5f6ca..1de1da7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,18 +38,21 @@ jobs: env: REF_NAME: ${{ github.ref_name }} - - name: Verify plugin.json version matches tag + - name: Verify package version matches tag env: TAG_NAME: ${{ github.ref_name }} run: | TAG_VERSION="${TAG_NAME#v}" - PLUGIN_VERSION=$(grep -oE '"version": *"[^"]*"' .claude-plugin/plugin.json | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - if [ "$TAG_VERSION" != "$PLUGIN_VERSION" ]; then - echo "::error::Tag version ($TAG_VERSION) does not match plugin.json version ($PLUGIN_VERSION)" + PACKAGE_VERSION=$(node -p "require('./package.json').version") + if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then + echo "::error::Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)" echo "Run: ./scripts/release.sh $TAG_VERSION" exit 1 fi + - name: Verify release metadata stays in sync + run: node tests/plugin-manifest.test.js + - name: Generate release highlights id: highlights env: diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 9fd37991..e6012659 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -47,6 +47,21 @@ jobs: exit 1 fi + - name: Verify package version matches tag + env: + INPUT_TAG: ${{ inputs.tag }} + run: | + TAG_VERSION="${INPUT_TAG#v}" + PACKAGE_VERSION=$(node -p "require('./package.json').version") + if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then + echo "::error::Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)" + echo "Run: ./scripts/release.sh $TAG_VERSION" + exit 1 + fi + + - name: Verify release metadata stays in sync + run: node tests/plugin-manifest.test.js + - name: Generate release highlights env: TAG_NAME: ${{ inputs.tag }}