Harden reusable workflows: pass event context via env vars - #3
Merged
Conversation
Bind github.event.* values to step-level env vars and reference them as shell variables instead of interpolating expressions directly into run scripts. Matches the env-binding convention already used elsewhere in these workflows (e.g. reusable-slack-issue-notification.yml).
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.
What
Bind
github.event.*values to step-levelenv:variables and reference them as shell variables, instead of interpolating the expressions directly intorun:scripts.reusable-strands-command.yml— Enforce authorization stepreusable-pr-security-review.yml— Resolve subject stepWhy
Referencing event context through env vars is the safer, more predictable pattern for shell steps and is already the convention used elsewhere in these workflows (e.g.
reusable-slack-issue-notification.yml). This makes the two remaining steps consistent with it.Notes
Behavior is unchanged — same values, same control flow. Callers pin these reusables by commit SHA, so consumer repos pick this up when they bump their pinned SHA.