File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 push :
77 tags :
88 - ' v*'
9+ workflow_dispatch :
10+ inputs :
11+ tag :
12+ description : ' Tag version to publish (e.g., 0.2.0)'
13+ required : true
14+ type : string
915
1016permissions :
1117 contents : read
1622 steps :
1723 - name : Checkout
1824 uses : actions/checkout@v4
25+ with :
26+ ref : ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/v{0}', inputs.tag) || '' }}
1927
2028 - name : Setup Node.js
2129 uses : actions/setup-node@v4
2634
2735 - name : Verify version matches tag
2836 run : |
29- TAG_VERSION="${GITHUB_REF#refs/tags/v}"
37+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
38+ TAG_VERSION="${{ inputs.tag }}"
39+ else
40+ TAG_VERSION="${GITHUB_REF#refs/tags/v}"
41+ fi
3042 PKG_VERSION=$(node -p "require('./package.json').version")
3143 if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
3244 echo "Error: Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
You can’t perform that action at this time.
0 commit comments