Skip to content

Commit 67e154d

Browse files
committed
Refactor Claude Code Action to streamline prompt handling by reading directly from the prompt file, enhancing clarity and efficiency in command execution.
1 parent fd13dc5 commit 67e154d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

.github/actions/claude-code-action/action.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,11 @@ runs:
228228
CMD_ARGS+=("--disallowedTools" "${{ inputs.disallowed_tools }}")
229229
fi
230230
231-
# Read the prompt content
232-
PROMPT_CONTENT=$(cat "${{ env.PROMPT_FILE }}")
231+
echo "📝 Executing Claude Code with prompt from file..."
233232
234-
echo "📝 Executing: claude ${CMD_ARGS[*]} \"[prompt content]\""
235-
236-
# Execute Claude Code with timeout using the timeout command
233+
# Execute Claude Code with timeout, using stdin for the prompt
237234
TIMEOUT_SECONDS=$((${{ inputs.timeout_minutes }} * 60))
238-
timeout $TIMEOUT_SECONDS claude "${CMD_ARGS[@]}" "$PROMPT_CONTENT"
235+
timeout $TIMEOUT_SECONDS claude "${CMD_ARGS[@]}" < "${{ env.PROMPT_FILE }}"
239236
240237
echo "✅ Claude Code execution completed"
241238
env:

0 commit comments

Comments
 (0)