Skip to content

Commit 11341ea

Browse files
committed
fix workflow
1 parent e03800c commit 11341ea

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/main-pr-merge-workflow.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,17 @@ jobs:
5454
uses: actions/checkout@v4
5555

5656
- name: form tag name
57-
id: set_tag_name
58-
run: |
59-
INPUT_VAR="${{ matrix.tag }}--tag_name"
60-
echo "::set-output name=release_tag::${{ fromJson(needs.prepare_release.outputs.all_outputs)[env.INPUT_VAR] }}"
57+
id: set_path_name
58+
run: echo "PATH_NAME=${{ matrix.tag }}--tag_name" >> $GITHUB_ENV
59+
60+
- name: Use github-script to access dynamic key
61+
id: set_release_tag
62+
uses: actions/github-script@v5
63+
with:
64+
script: |
65+
const allOutputs = JSON.parse('${{ needs.prepare_release.outputs.all_outputs }}');
66+
const releaseTag = allOutputs['${{ steps.set_path_name.outputs.PATH_NAME }}'];
67+
core.setOutput('releaseTag', releaseTag);
6168
6269
- name: Build and Release Go Binary
6370
uses: wangyoucao577/go-release-action@v1
@@ -68,5 +75,5 @@ jobs:
6875
goversion: "https://go.dev/dl/go1.22.0.linux-amd64.tar.gz"
6976
project_path: "image-action-gh/base-project/image-scan"
7077
binary_name: "image-scan"
71-
release_tag: ${{ steps.set_tag_name.outputs.release_tag }}
78+
release_tag: ${{ steps.set_release_tag.outputs.releaseTag }}
7279
overwrite: true

0 commit comments

Comments
 (0)