Repository navigation
fix(rules): scoped npm registries and same-branch guards (use-trusted-publishing, github-env) - #151
Merged
Merged
Conversation
…uards inside the branch of the write use-trusted-publishing: a registry set for one scope (@scope:registry) no longer hides the publish of every package. The package name is read from package.json (working-directory or folder argument); unscoped packages and packages of another scope are reported. When the name cannot be known with confidence the publish stays unreported. github-env: a validation guard inside the same if/else branch as the write now counts for the rest of that branch. Refs #102 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
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. Comment |
jdx
added a commit
that referenced
this pull request
Oct 10, 2026
🤖 I have created a release *beep* *boop* --- ## [2.1.0](v2.0.2...v2.1.0) (2026-10-10) ### Features * add JACTIONLINT_ONLINE to turn the online checks on from the environment ([#155](#155)) ([a17b716](a17b716)) * add the workflow-secret-scope rule ([#136](#136)) ([2885719](2885719)) * explain why a finding has no fix ([#135](#135)) ([5a65169](5a65169)) * **parallel-steps:** flag reads of a background step's outputs before its wait ([#132](#132)) ([540e948](540e948)) * **pipeline-without-pipefail:** follow PIPESTATUS into a later check ([#145](#145)) ([40d579e](40d579e)) * report online check coverage in SARIF ([#140](#140)) ([ba654bb](ba654bb)) * revisit three v2 defaults from [#106](#106) ([#152](#152)) ([aa19b18](aa19b18)) ### Bug Fixes * allow runs.env in composite actions ([#123](#123)) ([e0a95fc](e0a95fc)) * **bot-conditions:** suggest advice that matches the caller's actual event ([#141](#141)) ([a8dad0e](a8dad0e)) * **cache-poisoning:** evaluate the caller's input expression for composite actions ([#139](#139)) ([48ba93d](48ba93d)) * **cache-poisoning:** treat release branch pushes as releases and know more publishers ([#150](#150)) ([981e623](981e623)) * **ci:** fix problem matcher test and run it on PRs ([#134](#134)) ([80b358a](80b358a)) * **concurrency-limits:** avoid caller group collisions and cancelling release workflows ([#142](#142)) ([3f543aa](3f543aa)) * **docs:** say that default-minutes and default-days turn on the --fix fix ([#147](#147)) ([1c43358](1c43358)) * **events:** accept field_added/field_removed for issues ([#130](#130)) ([c5ec59a](c5ec59a)) * **fix:** refuse risky unquoted template-injection fixes, fix flow-style artipacked ([#154](#154)) ([ac7f40a](ac7f40a)) * **migrate-ignores:** migrate the root action.yml, report skipped comments, keep version comments ([#146](#146)) ([fec2e75](fec2e75)) * **missing-permissions:** do not require permissions in reusable-only workflows ([#138](#138)) ([387fb67](387fb67)) * **parallel-steps:** allow redundant background: true inside a parallel group ([#131](#131)) ([b1023d8](b1023d8)) * **pipeline-without-pipefail:** ignore pipelines in process substitutions ([#143](#143)) ([f8b0184](f8b0184)) * reject the keys GitHub refuses on wait, wait-all, cancel and parallel steps ([#128](#128)) ([85ee9dd](85ee9dd)) * **rules:** scoped npm registries and same-branch guards (use-trusted-publishing, github-env) ([#151](#151)) ([92b5064](92b5064)) * **untrusted-checkout:** follow a fetched pull request into a script of the repository ([#149](#149)) ([3eed721](3eed721)) ### Performance Improvements * parse each expression once and lex without allocating a scanner ([#153](#153)) ([6910e8b](6910e8b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a summary for commit 858b0d1. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #102
use-trusted-publishing: a scoped registry setting (@scope:registry) now hides a publish only when the package is of that scope. The name comes frompackage.json(step/job/workflowworking-directory, or the folder given tonpm publish). Unscoped packages and other scopes are reported. Kept conservative (unreported, documented in docs/checks.md) when the name is unknown: no readable manifest, expression orcd-changed directory, tarball or workspace selection, manifest possibly rewritten earlier, or an unscoped privateregistry.github-env: guards ([[ ]] || exit,if ... exit,case) inside anif/elsebranch are recorded with a scope and hold for the rest of that branch only. Bare[[ ]]relying onset -estill counts at the top level only; loops, functions and pipelines are not followed.Positive and negative tests added for both. No change to finding output, so matcher fixtures are unchanged.
🤖 Generated with Claude Code
Note
Medium Risk
Changes when security findings fire for GITHUB_ENV writes and npm publish credential checks; incorrect scope or manifest logic could miss issues or add noise, but only affects static analysis, not workflow execution.
Overview
Tightens two security lint rules so they match documented intent more closely.
github-env: Shell validation guards ([[ ]] || exit, branch exits,case) are now tracked with branch scope—a check inside anif/elsebody only protects writes later in that same branch. Top-level bare[[ ]]underset -estill counts; guards inside loops, functions, or pipelines are ignored. The github-env flow only applies a guard when the write offset is still within that scope.use-trusted-publishing: A scoped private registry (npm config set @scope:registry …) no longer suppresses every publish in the job. The rule readspackage.json(respecting working-directory and publish path) and treats the registry as private only when the published package name matches that scope; unscopedregistrystill applies to all packages. When the package name cannot be determined reliably, behavior stays conservative (no finding), with new tests and docs/checks.md updates for both rules.Reviewed by Cursor Bugbot for commit d32954e. Bugbot is set up for automated code reviews on this repo. Configure here.