fix: pass GitHub event context via env vars in reusable workflow#20
Merged
Conversation
Move github.event.* interpolations (pull_request.number, event.action) out of the inline run: script and into an env: block so they are referenced as shell variables rather than templated into script text. These values are GitHub-controlled and structurally constrained, so this is a defense-in-depth cleanup that also keeps CI/scanner patterns happy. Signed-off-by: Stephen Crowe <6042774+crowecawcaw@users.noreply.github.com>
jericht
approved these changes
Jul 7, 2026
epmog
approved these changes
Jul 7, 2026
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 was the problem/requirement? (What/Why)
The
Record PR Detailsreusable workflow interpolatedgithub.event.*values directly into an inlinerun:script.What was the solution? (How)
Move the
github.event.*values (pull_request.number,event.action) out of the inlinerun:script and into anenv:block, so they are referenced as shell variables rather than templated into the script text.What is the impact of this change?
No behavioral change — the artifact contents are identical. This is a small workflow-hygiene cleanup that keeps the pattern consistent with the other reusable workflows (e.g.
responded.yml) and with the equivalent workflow inaws-deadline/.github(aws-deadline#87).How was this change tested?
YAML validated locally. The values consumed are unchanged; only how they are passed to the shell differs.
Was this change documented?
n/a
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.