Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(security): switch DECISION from $GITHUB_ENV to $GITHUB_OUTPUT (#4990)

LearningCircuit2346f21ddcb1
diff --git a/.github/workflows/ai-code-reviewer.yml b/.github/workflows/ai-code-reviewer.yml
index df23908e36..061cd4d5c7 100644
--- a/.github/workflows/ai-code-reviewer.yml
+++ b/.github/workflows/ai-code-reviewer.yml
@@ -105,6 +105,7 @@ jobs:
chmod +x ai-reviewer.sh
- name: AI Code Review
+ id: ai-review
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
@@ -237,8 +238,20 @@ jobs:
# Handle workflow decision (after posting review and labels)
echo "AI decision: $DECISION"
- # Store the decision for later use
- echo "DECISION=$DECISION" >> "$GITHUB_ENV"
+ # Store the decision as a step output for the downstream
+ # "Fail Workflow if Requested" step. $GITHUB_OUTPUT is the modern
+ # mechanism — values are scoped to steps.<id>.outputs.<name> and
+ # cannot re-enter the runner's process environment, eliminating the
+ # $GITHUB_ENV injection class (zizmor github-env audit #8017).
+ #
+ # Defense-in-depth: an allowlist before the write blocks newline
+ # injection. If a manipulated model response put a newline in
+ # $DECISION, the bare echo above could write an additional output
+ # key. Outputs can't reach the process environment so impact is
+ # minimal, but the case statement closes the door cheaply and
+ # replaces the lost-on-rework intent of #4985.
+ case "$DECISION" in pass|fail) ;; *) DECISION="fail" ;; esac
+ echo "DECISION=$DECISION" >> "$GITHUB_OUTPUT"
# Remove the ai_code_review label so re-adding it re-triggers a review.
echo "Removing ai_code_review label to allow easy re-triggering"
@@ -259,7 +272,7 @@ jobs:
echo "✅ AI review completed successfully ($SUCCESS_COUNT/${#MODELS[@]} reviewers)"
- name: Fail Workflow if Requested
- if: env.FAIL_ON_REQUESTED_CHANGES == 'true' && env.DECISION == 'fail'
+ if: env.FAIL_ON_REQUESTED_CHANGES == 'true' && steps.ai-review.outputs.DECISION == 'fail'
run: |
echo "❌ AI requested changes and FAIL_ON_REQUESTED_CHANGES is enabled. Failing workflow."
echo "The review has been posted above. Please address the requested changes."