Conversation
…r flag compatibility Vitest 3 removed --coverageReporters CLI flag. Detect the installed Vitest major version at runtime and use --coverage.reporter (dot notation) for v3+, keeping --coverageReporters for Jest and Vitest 2. Closes #215
- Pin all external actions by SHA (checkout, setup-node, upload-artifact, download-artifact, github-script) - Quote $GITHUB_OUTPUT to satisfy SC2086 - Replace $? check with direct exit code test to satisfy SC2181 - Quote $BASE_SHA, $HEAD_SHA, $PREV_COMMIT variables
- Group GITHUB_OUTPUT writes with { } >> to satisfy SC2129
- Quote $GITHUB_STEP_SUMMARY to satisfy SC2086
…ions to env vars
Move ${{ }} expressions out of run: blocks into env: mappings to prevent
potential code injection via user-controlled inputs (github.base_ref,
matrix.app.name, coverage outputs, inputs.coverage_threshold).
Resolves all 7 CodeQL code-injection/medium findings.
…er-flag fix(frontend-pr-analysis): detect vitest version for coverage reporter flag
WalkthroughPinned GitHub Actions to commit SHAs for security hardening and refactored the frontend PR analysis workflow to use environment variables for changed file detection, added runtime Vitest version detection for coverage flag formatting, and consolidated coverage output writing into a single shell block. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested labels
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔍 Lint Analysis
|
🛡️ CodeQL Analysis ResultsLanguages analyzed: ✅ No security issues found. 🔍 View full scan logs | 🛡️ Security tab |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/frontend-pr-analysis.yml (1)
137-140: 🧹 Nitpick | 🔵 TrivialConsider env mapping for consistency.
These lines still interpolate
${{ }}directly in the run block. While step outputs and workflow inputs are generally trusted (unlike PR titles/branch names), mapping them throughenv:would maintain consistency with the refactored pattern in the previous step.Not a security issue since
steps.changed.outputs.filesandinputs.*are controlled sources, but consider for uniformity.♻️ Optional: Use env mapping
- name: Build matrix from changed paths id: set-matrix shell: bash + env: + FILES: ${{ steps.changed.outputs.files }} + FILTER_PATHS: ${{ inputs.filter_paths }} + PATH_LEVEL: ${{ inputs.path_level }} + APP_NAME_PREFIX: ${{ inputs.app_name_prefix }} run: | - FILES="${{ steps.changed.outputs.files }}" - FILTER_PATHS='${{ inputs.filter_paths }}' - PATH_LEVEL="${{ inputs.path_level }}" - APP_NAME_PREFIX="${{ inputs.app_name_prefix }}" + # Variables now come from env block🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/frontend-pr-analysis.yml around lines 137 - 140, Map the workflow inputs and step outputs through the step's env block instead of interpolating ${...} directly in the run block: define environment variables FILES, FILTER_PATHS, PATH_LEVEL, and APP_NAME_PREFIX using steps.changed.outputs.files and inputs.filter_paths / inputs.path_level / inputs.app_name_prefix in the step's env:, then reference those env vars (e.g., $FILES, $FILTER_PATHS, $PATH_LEVEL, $APP_NAME_PREFIX) inside the run script to match the refactored pattern and keep usage consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.github/workflows/frontend-pr-analysis.yml:
- Around line 137-140: Map the workflow inputs and step outputs through the
step's env block instead of interpolating ${...} directly in the run block:
define environment variables FILES, FILTER_PATHS, PATH_LEVEL, and
APP_NAME_PREFIX using steps.changed.outputs.files and inputs.filter_paths /
inputs.path_level / inputs.app_name_prefix in the step's env:, then reference
those env vars (e.g., $FILES, $FILTER_PATHS, $PATH_LEVEL, $APP_NAME_PREFIX)
inside the run script to match the refactored pattern and keep usage consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2e7e55d5-1f51-4f19-bcfb-9709ba05f2cc
📒 Files selected for processing (1)
.github/workflows/frontend-pr-analysis.yml
GitHub Actions Shared Workflows
Description
Type of Change
feat: New workflow or new input/output/step in an existing workflowfix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)perf: Performance improvement (e.g. caching, parallelism, reduced steps)refactor: Internal restructuring with no behavior changedocs: Documentation only (README, docs/, inline comments)ci: Changes to self-CI (workflows under.github/workflows/that run on this repo)chore: Dependency bumps, config updates, maintenancetest: Adding or updating testsBREAKING CHANGE: Callers must update their configuration after this PRBreaking Changes
None.
Testing
@developor the beta tagCaller repo / workflow run:
Related Issues
Closes #
Summary by CodeRabbit