Skip to content

Commit ef92573

Browse files
committed
fix: tag version
1 parent 17bab20 commit ef92573

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/version.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
env:
1616
VERSION: ${{ github.event.inputs.version }}
17+
outputs:
18+
tag: ${{ steps.get-tag.outputs.TAG }}
1719
steps:
1820
- run: |
1921
if [[ "$VERSION" != "major" ]] && [[ "$VERSION" != "minor" ]] && [[ "$VERSION" != "patch" ]]; then
@@ -31,11 +33,12 @@ jobs:
3133
node-version-file: package.json
3234
- run: npm ci
3335
- run: npm version $VERSION
36+
- id: get-tag
37+
run: |
38+
echo "TAG=$(npm run env | grep npm_package_version | cut -d '=' -f 2)" >> $GITHUB_OUTPUT
3439
npm:
3540
runs-on: ubuntu-latest
3641
needs: version
37-
env:
38-
VERSION: ${{ github.event.inputs.version }}
3942
steps:
4043
- uses: actions/checkout@v4
4144
- uses: actions/[email protected]
@@ -45,14 +48,12 @@ jobs:
4548
uses: JS-DevTools/npm-publish@v3
4649
with:
4750
token: ${{ secrets.NPM_TOKEN }}
48-
- run: |
49-
echo "TAG=$(npm run env | grep npm_package_version | cut -d '=' -f 2)" >> $GITHUB_ENV
5051
- name: Create Github Release
5152
uses: actions/create-release@v1
5253
env:
5354
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5455
with:
55-
tag_name: refs/tags/${{ env.TAG }}
56-
release_name: Version ${{ env.TAG }}
57-
body: Version ${{ env.TAG }}
56+
tag_name: refs/tags/${{ needs.version.outputs.TAG }}
57+
release_name: Version ${{ needs.version.outputs.TAG }}
58+
body: Version ${{ needs.version.outputs.TAG }}
5859

0 commit comments

Comments
 (0)