Skip to content

Commit f279f27

Browse files
hudeng-goBLumia
authored andcommitted
fix: avoid shell injection via PR body containing backticks
Move PR_BODY to an env variable instead of inline shell assignment to prevent backticks from being interpreted as command substitution. Log:
1 parent a38e737 commit f279f27

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/commitlint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ jobs:
1414

1515
- name: check PR description for AI co-author pattern
1616
shell: bash
17+
env:
18+
PR_BODY: ${{ github.event.pull_request.body }}
1719
run: |
1820
BLOCKED_PATTERN='Co-authored-by:.*ai|Co-authored-by:.*agent|Co-authored-by:.*copilot|Co-authored-by:.*llm|Co-authored-by:.*gpt'
19-
PR_BODY="${{ github.event.pull_request.body }}"
2021
if echo "${PR_BODY}" | grep -Eiq "${BLOCKED_PATTERN}"; then
2122
echo "FAIL: PR description contains blocked co-author AI pattern." >&2
2223
echo "Blocked pattern: ${BLOCKED_PATTERN}" >&2

0 commit comments

Comments
 (0)