Skip to content

Commit e6b2b70

Browse files
authored
chore: prevent untrusted code execution in commit checks (#888)
Signed-off-by: Nathanael DEMACON <ndemacon@scaleway.com>
1 parent e91ad63 commit e6b2b70

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/check-pull-request.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ jobs:
1919
- run: pnpm install
2020
- name: Check title
2121
run: |
22-
title="${{ github.event.pull_request.title }}"
23-
title_escaped=${title//\'/\'}
22+
title=$(cat <<- "EOF"
23+
${{ github.event.pull_request.title }}
24+
EOF
25+
)
2426
if [ "$title" == "feat: update generated APIs" ]; then
2527
echo "Invalid title."
2628
exit 1
2729
else
28-
echo "$title_escaped" | pnpm commitlint
30+
echo "$title" | pnpm commitlint
2931
fi

0 commit comments

Comments
 (0)