workflows/ci: fix template-injection zizmor findings#195318
Conversation
samford
left a comment
There was a problem hiding this comment.
Seeing some CI failures with a few of these changes:
Error: The template is not valid. .github/workflows/ci.yml (Line: 193, Col: 30): Error reading JToken from JsonReader. Path '', line 0, position 0.
Error: The template is not valid. .github/workflows/ci.yml (Line: 202, Col: 27): Error reading JToken from JsonReader. Path '', line 0, position 0.
Error: The template is not valid. .github/workflows/ci.yml (Line: 241, Col: 30): Error reading JToken from JsonReader. Path '', line 0, position 0.
In https://github.com/Homebrew/homebrew-cask/actions/runs/12342912865/job/34443307830?pr=195318 I suspect "Gather cask information" step got skipped, so some variables weren't set, and in the next steps, they're used in |
37dc7fd to
cdd799b
Compare
ea18b8a to
bd43a55
Compare
This updates `workflows/ci.yml` to use an environment variable to address a `template-injection` error from `zizmor`.
This updates `workflows/ci.yml` to use environment variables to address `template-injection` info from `zizmor`.
bd43a55 to
458430e
Compare
|
Nothing blew up when I ran this with a version bump commit (https://github.com/Homebrew/homebrew-cask/actions/runs/12505907895), so I think this is finally in a working state. There's some precedent for using the I've marked this as ready for review and it would be helpful for folks who are more familiar with the cask CI setup to look over these changes. |
Important: Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process.
In the following questions
<cask>is the token of the cask you're submitting.After making any changes to a cask, existing or new, verify:
brew audit --cask --online <cask>is error-free.brew style --fix <cask>reports no offenses.Additionally, if adding a new cask:
brew audit --cask --new <cask>worked successfully.HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask>worked successfully.brew uninstall --cask <cask>worked successfully.This updates
workflows/ci.ymlto use environment variables toaddress a
template-injectionerror and similar info output fromzizmor.I've added
# shellcheck disable=SC2086comments in a few places whereshellcheckwanted quotes but the strings consist of space-separated packages:Adding quotes in those instances would cause
brewto interpret something like"one two three"as one package with that name instead of three packages. If there's a better way to handle this, let me know.As with my other recent actions PRs, I'm not very knowledgeable about GitHub Actions, so I've created this as a draft until more knowledgeable maintainers have a chance to review this and catch any mistakes.