Skip to content

Commit 449ce0d

Browse files
fix: resolve release workflow validation error for tag expression (#156)
Move release tag expression out of github-script block into job env (RELEASE_TAG) and step env (TAG_NAME) to avoid parser error: Unexpected symbol when expression was embedded inside the script string.
1 parent 10153b2 commit 449ce0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ jobs:
3232
needs: call-reusable-workflow
3333
runs-on: ubuntu-latest
3434
if: always()
35+
env:
36+
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name || github.event.release.tag_name }}
3537
steps:
3638
- name: Update release status
3739
uses: actions/github-script@v7
40+
env:
41+
TAG_NAME: ${{ env.RELEASE_TAG }}
3842
with:
3943
script: |
40-
const tagName = '${{ github.event_name == "workflow_dispatch" && github.event.inputs.tag_name || github.event.release.tag_name }}';
44+
const tagName = process.env.TAG_NAME;
4145
const { data: releases } = await github.rest.repos.listReleases({
4246
owner: context.repo.owner,
4347
repo: context.repo.repo

0 commit comments

Comments
 (0)