Skip to content

🐛 Fix GitHub Actions workflow bugs and typos#6865

Merged
philipbalinov merged 2 commits intomainfrom
fix/github-actions-bugs
Mar 27, 2026
Merged

🐛 Fix GitHub Actions workflow bugs and typos#6865
philipbalinov merged 2 commits intomainfrom
fix/github-actions-bugs

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 9, 2026

Summary

  • reusable-lint-providers.yml: BASE_SHA was never set, so the only-new-issues input (used by pr-extended-linting.yml) silently did nothing. Now passes github.event.pull_request.base.sha so --new-from-rev actually filters to new issues.
  • providers.yaml: Quoted ${{ steps.providers.outputs.* }} in the debug echo to prevent shell word-splitting of JSON arrays. Also fixed "select" → "selected" typo.
  • Typos: "Provider PAth" → "Provider Path" (pr-test-lint.yml), "becasue" → "because" (release-providers.yml)

Test plan

  • Verify pr-extended-linting now shows only new lint issues on a PR with known lint changes
  • Confirm provider build scoping debug output is properly formatted

🤖 Generated with Claude Code

- reusable-lint-providers: pass BASE_SHA from PR context so only-new-issues
  actually filters to new issues instead of silently doing nothing
- pr-test-lint: add pull_request trigger so fork PRs get tested
- providers.yaml: quote step outputs to prevent shell word-splitting
- Fix typos: "Provider PAth" → "Provider Path", "becasue" → "because",
  "select to build" → "selected to build"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Good bugfix PR: typo corrections, missing pull_request trigger, security fix for shell injection, and a shallow fetch improvement.

@tas50 tas50 requested a review from philipbalinov March 9, 2026 23:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

Test Results

5 356 tests  ±0   5 352 ✅ ±0   2m 40s ⏱️ +9s
  411 suites ±0       4 💤 ±0 
   31 files   ±0       0 ❌ ±0 

Results for commit d247a2c. ± Comparison against base commit abb4667.

♻️ This comment has been updated with latest results.

@philipbalinov
Copy link
Copy Markdown
Contributor

/review carefully analyze the pr-test-lint.yml file for potential security issues, as this will be run for fork PRs that we have no control over

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Good housekeeping PR fixing typos, a missing pull_request trigger, a security issue, and a linting bug — with one notable injection fix.

- ".github/workflows/pr-test-lint.yml"
- ".github/workflows/reusable-lint-providers.yml"
- "**.toml" # run tests when any recording changed
pull_request:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this would allow running the workflow against forked PR - i'd be hesitant to do it as-is; at the very least, we have steps that run on our self-hosted runners, and allowing 3rd party code to execute against those is probably not a good idea

Self-hosted runners should not execute untrusted fork code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tas50
Copy link
Copy Markdown
Member Author

tas50 commented Mar 19, 2026

Good catch — reverted the pull_request trigger in d247a2c. The self-hosted runner concern is valid; we shouldn't be running untrusted fork code on those.

Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

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

Good bug fixes: missing env var, shell injection risk, typos, and trailing whitespace

- name: Run golangci-lint on all providers
env:
ONLY_NEW_ISSUES: ${{ inputs.only-new-issues }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 critical — Good catch — BASE_SHA was referenced in the script but never set as an environment variable. This fix is correct and necessary for the --new-from-rev logic to work at all.

run: |
echo "=== Providers detected:"
echo ${{ steps.providers.outputs.providers }}
echo '${{ steps.providers.outputs.providers }}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 warning — Good fix. Quoting the expression with single quotes prevents shell word-splitting and glob expansion on the output, which also mitigates a potential script injection vector if the output contained attacker-controlled content. Correct as-is.

@philipbalinov philipbalinov merged commit e3ffb22 into main Mar 27, 2026
21 checks passed
@philipbalinov philipbalinov deleted the fix/github-actions-bugs branch March 27, 2026 17:59
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants