From d605a1bf32c9e93f9ec9aa217c333df7807ce2bd Mon Sep 17 00:00:00 2001 From: Ivan Cherviakov Date: Fri, 3 Jul 2026 14:22:58 +0700 Subject: [PATCH 1/2] ci(audit-action): fix release trigger to main and bump to 3.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release workflow triggered on pull_request to `master`, but the repository's default branch is `main`, so it never fired — no v3.2.x tag was ever created despite package.json sitting at 3.2.0. Point the trigger at `main` and bump the patch version so the lockfile-closure fix (#15) can be published. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/release.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5310979..4d76e77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: pull_request: branches: - - master + - main types: - closed diff --git a/package.json b/package.json index 413eec9..796f68b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "audit-action", - "version": "3.2.0", + "version": "3.2.1", "private": true, "main": "dist/index.js", "packageManager": "pnpm@10.33.0", From c607a8303ed634f4f038550ad646b4d46d9d0f0f Mon Sep 17 00:00:00 2001 From: Ivan Cherviakov Date: Fri, 3 Jul 2026 14:24:25 +0700 Subject: [PATCH 2/2] ci(audit-action): skip release cleanly when version unchanged Gate the release step on an output flag instead of letting `grep -q` fail the job: merges to main that don't bump package.json now skip the release steps (green) rather than reporting a failed workflow run. Add a `merged == true` job guard so closed-but-unmerged PRs don't trigger it, and let workflow_dispatch force a release of the current version. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/release.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d76e77..03554ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,21 +12,28 @@ jobs: create_release: name: releasing a new version runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true steps: - uses: actions/checkout@v6 with: fetch-depth: 2 - - name: package.json has changed - run: git diff --name-only HEAD~1 HEAD | grep -q package.json + - name: check package.json version changed + id: check + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ] || git diff --name-only HEAD~1 HEAD | grep -q '^package.json$'; then + echo "changed=true" >> "$GITHUB_OUTPUT" + else + echo "changed=false" >> "$GITHUB_OUTPUT" + fi - name: new package.json version + if: steps.check.outputs.changed == 'true' id: version - run: | - version=$(cat package.json | jq -er '.version') - echo "result=${version}" >> $GITHUB_OUTPUT + run: echo "result=$(jq -er '.version' package.json)" >> "$GITHUB_OUTPUT" - uses: softprops/action-gh-release@v3 + if: steps.check.outputs.changed == 'true' with: tag_name: ${{ format('v{0}', steps.version.outputs.result) }}