Skip to content

Commit bb3b517

Browse files
committed
Fix: GitHub workflow script injection
Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
1 parent 3ad9234 commit bb3b517

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
permissions:
1313
contents: write
1414

15+
env:
16+
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
17+
1518
jobs:
1619
build_and_publish:
1720
name: Publish a new version
@@ -24,15 +27,15 @@ jobs:
2427
- name: Extract version from commit message
2528
id: extract_version
2629
run: |
27-
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP '(?<=REL: )\d+\.\d+\.\d+')
30+
VERSION=$(echo "$HEAD_COMMIT_MESSAGE" | grep -oP '(?<=REL: )\d+\.\d+\.\d+')
2831
echo "version=$VERSION" >> $GITHUB_OUTPUT
2932
3033
- name: Extract tag message from commit message
3134
id: extract_message
3235
run: |
3336
VERSION="${{ steps.extract_version.outputs.version }}"
3437
delimiter="$(openssl rand -hex 8)"
35-
MESSAGE=$(echo "${{ github.event.head_commit.message }}" | sed "0,/REL: $VERSION/s///" )
38+
MESSAGE=$(echo "$HEAD_COMMIT_MESSAGE" | sed "0,/REL: $VERSION/s///" )
3639
echo "message<<${delimiter}" >> $GITHUB_OUTPUT
3740
echo "$MESSAGE" >> $GITHUB_OUTPUT
3841
echo "${delimiter}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)