fix: use correct GitHub context for reusable workflow#6
Merged
Conversation
Fixed context references to work properly with workflow_call trigger. Issues Fixed: - Removed explicit ref from checkout (uses default SHA from caller) - Changed github.event.pull_request.base.ref to github.base_ref - Changed github.event.pull_request.user.login to github.actor - Updated PR comment to use context.payload.pull_request - Updated Slack notification with available context variables This ensures the workflow works correctly when called from PR workflows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Fixed GitHub context references in the reusable secrets detection workflow to work properly with
workflow_calltrigger.Issues Fixed
reffrom checkout step (automatically uses correct SHA from caller workflow)github.event.pull_request.base.reftogithub.base_ref(available in workflow_call context)github.event.pull_request.user.logintogithub.actorcontext.payload.pull_request?.numberRoot Cause
The original workflow was written for direct
pull_requesttriggers, but when called viaworkflow_call, thegithub.event.pull_requestobject is not available. The fix uses context variables that are available in reusable workflows.Testing
After merging, the hermes repository workflow will be updated to reference the new commit SHA.
🤖 Generated with Claude Code