Skip to content

Commit 064c89a

Browse files
mikolalysenkoclaude
andcommitted
Fix publish workflow to checkout the bumped version
The publish job was checking out the commit that triggered the workflow, not the new commit with the bumped version. Now we capture the new tag from the bump step and pass it as the ref to the reusable publish workflow. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a959895 commit 064c89a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ permissions:
3232
jobs:
3333
bump-version:
3434
runs-on: ubuntu-latest
35+
outputs:
36+
new-tag: ${{ steps.bump.outputs.new-tag }}
3537
steps:
3638
- name: Checkout
3739
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
@@ -47,7 +49,10 @@ jobs:
4749
git config user.email "github-actions[bot]@users.noreply.github.com"
4850
4951
- name: Bump version
50-
run: npm version ${{ inputs.version-bump }} -m "v%s"
52+
id: bump
53+
run: |
54+
npm version ${{ inputs.version-bump }} -m "v%s"
55+
echo "new-tag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"
5156
5257
- name: Push changes
5358
run: git push && git push --tags
@@ -60,5 +65,6 @@ jobs:
6065
dist-tag: ${{ inputs.dist-tag }}
6166
package-name: '@socketsecurity/socket-patch'
6267
publish-script: 'publish:ci'
68+
ref: ${{ needs.bump-version.outputs.new-tag }}
6369
setup-script: 'pnpm run build'
6470
use-trusted-publishing: true

0 commit comments

Comments
 (0)