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