Skip to content

fix: use correct GitHub context for reusable workflow#6

Merged
acsrujan merged 1 commit intomasterfrom
fix-reusable-workflow-context
Jan 20, 2026
Merged

fix: use correct GitHub context for reusable workflow#6
acsrujan merged 1 commit intomasterfrom
fix-reusable-workflow-context

Conversation

@acsrujan
Copy link
Contributor

Summary

Fixed GitHub context references in the reusable secrets detection workflow to work properly with workflow_call trigger.

Issues Fixed

  • Removed explicit ref from checkout step (automatically uses correct SHA from caller workflow)
  • Changed github.event.pull_request.base.ref to github.base_ref (available in workflow_call context)
  • Changed github.event.pull_request.user.login to github.actor
  • Updated PR comment step to properly access context.payload.pull_request?.number
  • Updated Slack notification with context variables available in workflow_call

Root Cause

The original workflow was written for direct pull_request triggers, but when called via workflow_call, the github.event.pull_request object 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

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>
@acsrujan acsrujan merged commit a18f6ce into master Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant