Skip to content

Allow bin/use_packwerk move to move around entries in per-pack .rubocop_todo.yml files - #4

Merged
alexevanczuk merged 6 commits into
mainfrom
ae-allow-up-to-work-with-rubocop-per-pack
Aug 3, 2022
Merged

Allow bin/use_packwerk move to move around entries in per-pack .rubocop_todo.yml files#4
alexevanczuk merged 6 commits into
mainfrom
ae-allow-up-to-work-with-rubocop-per-pack

Conversation

@alexevanczuk

Copy link
Copy Markdown
Contributor

This will allow per-pack .rubocop_todo.yml files to be modified correctly when files move between packs or are made public.

@alexevanczuk
alexevanczuk merged commit 329aea3 into main Aug 3, 2022
@alexevanczuk
alexevanczuk deleted the ae-allow-up-to-work-with-rubocop-per-pack branch August 3, 2022 20:44
dduugg added a commit that referenced this pull request Aug 17, 2026
Adds explicit least-privilege GITHUB_TOKEN permissions to the three
reusable-workflow callers that had none (alerts #4, #2, #1), matching the
job-level style already used in ci.yml and codeql.yml:

- cd.yml -> contents: write. shared-config's cd.yml checks out with
  persisted credentials and runs discourse/publish-rubygems-action
  (rake release does a raw git push of the version tag) followed by
  gh release create, both of which need write access to contents.
- stale.yml -> issues: write + pull-requests: write. shared-config's
  stale.yml runs actions/stale, which comments on and closes both stale
  issues and stale pull requests.
- triage.yml -> issues: write. shared-config's triage.yml runs
  gh issue edit --add-label triage.

Fixes the two rb/shell-command-constructed-from-input alerts (#5, #6) in
Packs.check, where the caller-supplied file list was interpolated into a
single string handed to Kernel#system and therefore to /bin/sh. A path
containing a space, quote, semicolon or backtick would have been
re-interpreted by the shell.

Private.system_with now takes the argv array and splats it into system,
so the command is exec'd directly and never goes through a shell. All six
callers in lib/packs.rb and the two specs that stub the seam are updated.
The sig is params(argv: T::Array[String]); T.unsafe is needed only because
Sorbet cannot type-check a splat of statically unknown size.

srb tc, rspec (119 examples) and rubocop all pass; actionlint is clean on
the workflow files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants