Merge pull request #586 from safedep/fix/npm-publish-use-head-branch-tag

use head_branch for extracting tag
This commit is contained in:
Kunal Singh 2025-08-27 18:21:55 +05:30 committed by GitHub
commit e4e9dc2590
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,12 +24,12 @@ jobs:
- name: Extract Tag Version - name: Extract Tag Version
id: version id: version
run: | run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then TAG_VERSION="${{ github.event.workflow_run.head_branch }}"
TAG_VERSION="${{ github.ref }}" if [[ "$TAG_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
TAG_VERSION="${TAG_VERSION#refs/tags/}" VERSION="${TAG_VERSION#v}" # Remove leading 'v'
echo "version=$TAG_VERSION" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT
else else
echo "No tag found." echo "No valid tag found in head_branch: $TAG_VERSION"
exit 1 exit 1
fi fi
- name: Prepare package - name: Prepare package