Skip to content

Commit 83ef461

Browse files
authored
Prevent shell command execution from commit messages (#15)
Previously, commit messages were passed via a variable, which allowed embedded shell commands (e.g. `$(...)`) to be executed during parsing. For example, this happened in this run: https://github.com/tarantool/sdvg/actions/runs/16798902022/job/47575402000 Now the message is fetched directly via `git` and safely piped through `sed`, ensuring arbitrary code is not executed.
1 parent 897ffa0 commit 83ef461

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ jobs:
3232
exit 0
3333
fi
3434
35-
VERSION=$(echo "${{ github.event.head_commit.message }}" \
36-
| sed -nE 's/.*[Rr]elease ([0-9]+\.[0-9]+\.[0-9]+).*?/\1/p')
35+
VERSION=$(git log -1 --pretty=%B | sed -nE 's/.*[Rr]elease ([0-9]+\.[0-9]+\.[0-9]+).*?/\1/p')
3736
3837
if [ -z "${VERSION}" ]; then
3938
echo "No semantic version found in commit message"

0 commit comments

Comments
 (0)