mirror of https://github.com/garrytan/gstack.git
Merge branch 'pr-472' into garrytan/merge-open-prs
This commit is contained in:
commit
fbd478699d
|
|
@ -6,4 +6,13 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
eval "$("$SCRIPT_DIR/gstack-slug" 2>/dev/null)"
|
eval "$("$SCRIPT_DIR/gstack-slug" 2>/dev/null)"
|
||||||
GSTACK_HOME="${GSTACK_HOME:-$HOME/.gstack}"
|
GSTACK_HOME="${GSTACK_HOME:-$HOME/.gstack}"
|
||||||
mkdir -p "$GSTACK_HOME/projects/$SLUG"
|
mkdir -p "$GSTACK_HOME/projects/$SLUG"
|
||||||
echo "$1" >> "$GSTACK_HOME/projects/$SLUG/$BRANCH-reviews.jsonl"
|
|
||||||
|
# Validate: input must be parseable JSON (reject malformed or injection attempts)
|
||||||
|
INPUT="$1"
|
||||||
|
if ! printf '%s' "$INPUT" | python3 -c "import json,sys; json.load(sys.stdin)" 2>/dev/null; then
|
||||||
|
# Not valid JSON — refuse to append
|
||||||
|
echo "gstack-review-log: invalid JSON, skipping" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$INPUT" >> "$GSTACK_HOME/projects/$SLUG/$BRANCH-reviews.jsonl"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue