Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit bc4bd9b

Browse files
domwoeclaude
andcommitted
fix: prevent command injection in deploy workflow commit message
The commit message was being directly interpolated into bash script, causing words like 'dfx' and 'to' to be interpreted as commands. Solution: Use GitHub Actions env block to safely pass commit message as environment variable, which properly escapes special characters. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2ae4a09 commit bc4bd9b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
8787
- name: Determine deployment mode
8888
id: deploy-mode
89+
env:
90+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
8991
run: |
9092
# Determine deployment mode with multiple strategies:
9193
# 1. Manual workflow dispatch - use selected mode
@@ -97,10 +99,8 @@ jobs:
9799
MODE="${{ github.event.inputs.deploy_mode }}"
98100
echo "✅ Using manual deployment mode: $MODE"
99101
elif [ "${{ github.event_name }}" = "push" ]; then
100-
# Check for commit message override
101-
COMMIT_MSG="${{ github.event.head_commit.message }}"
102-
103-
if echo "$COMMIT_MSG" | grep -qi '\[frontend-only\]'; then
102+
# Check for commit message override (using env var for safe handling)
103+
if echo "$COMMIT_MESSAGE" | grep -qi '\[frontend-only\]'; then
104104
MODE="frontend-only"
105105
echo "🏷️ Commit message tag [frontend-only] detected → frontend-only deployment"
106106
else

0 commit comments

Comments
 (0)