ci: harden welcome.yml and silence zizmor dangerous-triggers#908
Open
anevolbap wants to merge 1 commit into
Open
ci: harden welcome.yml and silence zizmor dangerous-triggers#908anevolbap wants to merge 1 commit into
anevolbap wants to merge 1 commit into
Conversation
Suppress zizmor dangerous-triggers with an inline justification, set
top-level permissions to {} and grant issues/pull-requests write at the
job level only, and hoist github.actor into env:.
Closes pymc-labs#888
Contributor
Author
|
Going with option 1 from the issue: inline zizmor ignore with a written justification, top-level |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #908 +/- ##
=======================================
Coverage 94.87% 94.87%
=======================================
Files 85 85
Lines 13174 13174
Branches 793 793
=======================================
Hits 12499 12499
Misses 479 479
Partials 196 196 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Documentation build overview
25 files changed ·
|
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.
Resolve zizmor
dangerous-triggersalert onwelcome.ymlCloses #888.
Summary
The welcome workflow uses
pull_request_targetso it can comment and label PRs from forks (the read-onlypull_requesttoken cannot write). zizmor flags this trigger categorically, but the usage here is one of the documented safe cases. This PR suppresses the alert with an inline justification and applies defense-in-depth hardening so the rationale lives next to the code.Changes
# zizmor: ignore[dangerous-triggers]on the trigger with a short justification.permissions: {}(deny-all), withissues: writeandpull-requests: writemoved to the job.github.actorinto a job-levelenv: ACTORand reference${{ env.ACTOR }}in the action inputs.No behavior change.
Testing
prek run --files .github/workflows/welcome.ymlpasses.pull_request_target/issuesevents, so end-to-end validation will happen on the next first-time contributor event.