Skip to content

Commit 99c6661

Browse files
author
flowcore-platform
committed
fix(fetch-prompt): improve handling of custom prompt file fallback
- Updated the script to prioritize CUSTOM_PROMPT_FILE (set by action.yml) over PROMPT_FILE for local testing. - Enhanced error messages to provide clearer context on the availability of prompt files. - Ensured that the existence check reflects the correct variable being used, improving debugging information. This change aims to streamline the prompt file handling process and improve user feedback during execution.
1 parent 366afe4 commit 99c6661

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/fetch-prompt.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ main() {
169169
fi
170170
else
171171
# Static prompt file
172-
CUSTOM_PROMPT_FILE="${PROMPT_FILE:-}"
172+
# Use CUSTOM_PROMPT_FILE (set by action.yml) or fall back to PROMPT_FILE (for local testing)
173+
CUSTOM_PROMPT_FILE="${CUSTOM_PROMPT_FILE:-${PROMPT_FILE:-}}"
174+
173175
if [ -n "$CUSTOM_PROMPT_FILE" ] && [ -f "$CUSTOM_PROMPT_FILE" ]; then
174176
echo "Using static prompt file: $CUSTOM_PROMPT_FILE"
175177
cp "$CUSTOM_PROMPT_FILE" "$USER_PROMPT_FILE"
@@ -178,8 +180,9 @@ main() {
178180
echo "Size: $(wc -c < "$USER_PROMPT_FILE") bytes"
179181
else
180182
echo "::error::No user prompt file provided or file not found"
183+
echo " CUSTOM_PROMPT_FILE: ${CUSTOM_PROMPT_FILE:-not set}"
181184
echo " PROMPT_FILE: ${PROMPT_FILE:-not set}"
182-
echo " File exists: $([ -f "${PROMPT_FILE:-}" ] && echo "yes" || echo "no")"
185+
echo " File exists: $([ -f "${CUSTOM_PROMPT_FILE:-}" ] && echo "yes" || echo "no")"
183186
exit 1
184187
fi
185188
fi

0 commit comments

Comments
 (0)