Skip to content

fix: wrap piped if conditions in parentheses - #527

Closed
shenxianpeng wants to merge 1 commit into
v3.0.0-rc0from
claude/project-thread-o3a1qc
Closed

shenxianpeng wants to merge 1 commit into
v3.0.0-rc0from
claude/project-thread-o3a1qc

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Not needed: d34259f, pushed to v3.0.0-rc0 a minute before this pull request was opened, already makes the same two-line change. Closing.

Problem

Every run of the action at b30de81 fails in the "Run cpp-linter" step before cpp-linter starts:

Error: nu::parser::missing_positional
  x Missing required positional argument.
 63 | if $env.INPUT_SUMMARY_OUTPUT_FILE | is-not-empty {
    :                                  `-- missing then_block

nushell reads if $env.X | is-not-empty { as if $env.X piped into another command, so the if has no block. It is a parse error, so it does not depend on the inputs.

Fix

Wrap the two conditions added in b30de81 in parentheses, like every other if in action.yml:

if ($env.INPUT_SUMMARY_OUTPUT_FILE | is-not-empty) {
if ($env.INPUT_DATABASE | is-not-empty) {

nushell reads `if $env.X | is-not-empty {` as `if $env.X` piped into
another command, so the script fails to parse with "missing then_block"
before cpp-linter starts. This broke every run of the action on this
branch, whatever the inputs were.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 12, 2026 19:34
@shenxianpeng
shenxianpeng requested review from 2bndy5 and removed request for a team November 12, 2026 19:34
@shenxianpeng shenxianpeng self-assigned this Nov 12, 2026
@github-actions github-actions Bot added the bug Something isn't working label Nov 12, 2026
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.

1 participant