name: 'Evals: PR Guidance' on: pull_request: paths: - 'packages/core/src/**/*.ts' - '!**/*.test.ts' - '!**/*.test.tsx' permissions: pull-requests: 'write' contents: 'read' jobs: provide-guidance: name: 'Model Steering Guidance' runs-on: 'ubuntu-latest' if: "github.repository == 'google-gemini/gemini-cli'" steps: - name: 'Checkout' uses: 'actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955' # ratchet:actions/checkout@v4 with: fetch-depth: 0 - name: 'Set up Node.js' uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4.4.0 with: node-version-file: '.nvmrc' cache: 'npm' - name: 'Detect Steering Changes' id: 'detect' run: | STEERING_DETECTED=$(node scripts/changed_prompt.js --steering-only) echo "STEERING_DETECTED=$STEERING_DETECTED" >> "$GITHUB_OUTPUT" - name: 'Analyze PR Content' if: "steps.detect.outputs.STEERING_DETECTED == 'true'" id: 'analysis' env: GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}' run: | # Check for behavioral eval changes EVAL_CHANGES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep "^evals/" || true) if [ -z "$EVAL_CHANGES" ]; then echo "MISSING_EVALS=true" >> "$GITHUB_OUTPUT" fi # Check if user is a maintainer (has write/admin access) USER_PERMISSION=$(gh api repos/${{ github.repository }}/collaborators/${{ github.actor }}/permission --jq '.permission') if [[ "$USER_PERMISSION" == "admin" || "$USER_PERMISSION" == "write" ]]; then echo "IS_MAINTAINER=true" >> "$GITHUB_OUTPUT" fi - name: 'Post Guidance Comment' if: "steps.detect.outputs.STEERING_DETECTED == 'true'" uses: 'thollander/actions-comment-pull-request@65f9e5c9a1f2cd378bd74b2e057c9736982a8e74' # ratchet:thollander/actions-comment-pull-request@v3 with: comment-tag: 'eval-guidance-bot' message: | ### 🧠 Model Steering Guidance This PR modifies files that affect the model's behavior (prompts, tools, or instructions). ${{ steps.analysis.outputs.MISSING_EVALS == 'true' && '- ⚠️ **Consider adding Evals:** No behavioral evaluations (`evals/*.eval.ts`) were added or updated in this PR. Consider adding a test case to verify the new behavior and prevent regressions.' || '' }} ${{ steps.analysis.outputs.IS_MAINTAINER == 'true' && '- 🚀 **Maintainer Reminder:** Please ensure that these changes do not regress results on benchmark evals before merging.' || '' }} --- *This is an automated guidance message triggered by steering logic signatures.*