Skip to content

fix: pass action inputs to run steps through env - #508

Merged
shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-huu4p1
Oct 23, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
claude/project-thread-huu4p1

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

The nu run: scripts in action.yml expanded ${{ inputs.* }} and ${{ github.event.pull_request.* }} directly into the script text. This is the pattern zizmor reports as template-injection: a value with a quote in it becomes part of the script. This PR passes those values to each step with env: and reads them with $env.* instead, which is GitHub's recommended way.

  • Every nu step that used an input now declares it under env: (INPUT_<NAME>, plus PR_HEAD_SHA / PR_HEAD_REPO), and runner.os / github.repository use the runner's RUNNER_OS / GITHUB_REPOSITORY.
  • Each of those steps starts with a load-env line that sets any of its variables that are missing to "", so an empty input behaves the same as before on every runner.
  • llvm.sh still gets no version argument when version is empty (it then installs its default), same as before.
  • No change to inputs, outputs or behavior. The only ${{ }} left in action.yml is the cache step's with:.

Checked locally: zizmor --offline action.yml reports no findings (45 template-injection before); every step script passes nu --ide-check; the Run cpp-linter step run with a fake uv passes values with quotes and spaces (for example -DX='a b') through as single arguments, and still works when most inputs are unset.

Related Issues

None.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of supplied settings across compiler installation, dependency setup, linting, pull request checkout, and automatic commits.
    • Existing version handling, lint options, branch and fork safeguards, staging behavior, commit defaults, and failure outcomes remain unchanged.

Inputs and pull request fields were expanded with ${{ }} directly inside
the nu scripts, so a value with a quote could change the script. They now
reach each step as environment variables and are read with $env.

The llvm.sh installer still gets no version argument when version is empty.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner October 22, 2026 20:29
@shenxianpeng
shenxianpeng requested review from 2bndy5 and removed request for a team October 22, 2026 20:29
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v16.0.6) reports: 2 file(s) not formatted
  • docs/examples/demo/demo.cpp
  • docs/examples/demo/demo.hpp
clang-tidy (v16.0.6) reports: 7 concern(s)

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions Bot added the bug Something isn't working label Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4cbacf0-2718-4344-a36e-bb9ae5c2fd25
📥 Commits

Reviewing files that changed from the base of the PR and between 94bdce8 and ab927fe.

📒 Files selected for processing: 1
  • action.yml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The action now passes inputs to Nushell scripts through environment variables. The installation, dependency setup, checkout, lint, and auto-commit steps read those values from the environment and default unset inputs to empty strings.

Changes

Action input handling

Layer / File(s) Summary
Compiler installation
action.yml
Linux and macOS installation steps read the version from the environment to construct package and tool names. The Linux installer omits the version argument when the value is empty.
Dependency setup and tool selection
action.yml
Dependency setup reads version, verbosity, tidy checks, and style from environment variables. Existing conditions for selecting clang-tidy and clang-format remain in place.
PR checkout and lint execution
action.yml
The checkout and linter steps read inputs from environment variables. The linter builds its arguments from those values, and the Linux platform check reads RUNNER_OS.
Auto-commit formatted changes
action.yml
The auto-commit step reads repository, extension, Git identity, commit message, and PR metadata values from the environment. Existing fork checks and fallback values remain in place.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to ab927

The changed action steps appear to preserve their input handling while avoiding direct interpolation into run scripts. No actionable merge risk remains after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: passing action inputs to run steps through environment variables.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@2bndy5 2bndy5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, I think this approach (where each input is exported as a INPUT_* env var) is automatic for docker-based actions.

@shenxianpeng
shenxianpeng merged commit d5c9433 into main Oct 23, 2026
45 checks passed
@shenxianpeng
shenxianpeng deleted the claude/project-thread-huu4p1 branch October 23, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants