Skip to content

BUILD-10311 Auto-select Vault role based on GITHUB_REF#70

Merged
jayadeep-km-sonarsource merged 1 commit intomasterfrom
feat/jd/BUILD-10311-wrapperAutoRoleSelection
Feb 5, 2026
Merged

BUILD-10311 Auto-select Vault role based on GITHUB_REF#70
jayadeep-km-sonarsource merged 1 commit intomasterfrom
feat/jd/BUILD-10311-wrapperAutoRoleSelection

Conversation

@jayadeep-km-sonarsource
Copy link
Contributor

@jayadeep-km-sonarsource jayadeep-km-sonarsource commented Feb 5, 2026

BUILD-10311 Auto-select Vault role based on GITHUB_REF

Implements automatic role selection for branch-based secret protection as part of the BUILD-10240 epic.

Changes

  • New role input: Optional parameter to explicitly specify the Vault JWT role (backward compatible)
  • Auto-selection logic: When role is not provided, selects based on GITHUB_REF:
    • Protected refs (refs/heads/main, refs/heads/master, refs/tags/*) → github-{org}-{repo}-protected
    • Other refs → github-{org}-{repo}
  • Debug logging: Logs selected role and detection reason via core.info()
  • Documentation: Added Role Selection section to README

Dependencies

Related

@jayadeep-km-sonarsource jayadeep-km-sonarsource marked this pull request as ready for review February 5, 2026 09:12
@jayadeep-km-sonarsource jayadeep-km-sonarsource requested a review from a team as a code owner February 5, 2026 09:12
Copilot AI review requested due to automatic review settings February 5, 2026 09:12
@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-10311-wrapperAutoRoleSelection branch from 5467190 to 3cddf6d Compare February 5, 2026 09:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements automatic Vault JWT role selection based on the Git ref to enable branch-based secret protection. Protected branches (main, master) and tags automatically use a -protected role suffix, while other refs (feature branches, PRs) use the base role.

Changes:

  • Adds optional role input parameter for explicit role override (maintains backward compatibility)
  • Implements auto-selection logic that chooses between github-{org}-{repo}-protected and github-{org}-{repo} based on GITHUB_REF patterns
  • Adds documentation explaining role selection behavior in README and new CLAUDE.md file

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
action.yaml Adds role input parameter and implements auto-selection logic with pattern matching for protected refs (main, master, tags/*)
README.md Documents the role selection feature with examples and explains the branch-based protection model
CLAUDE.md New developer documentation file summarizing the project, role selection, and release process

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add automatic role selection for branch-based secret protection:
- Protected refs (main, master, branch-*, tags/*) use github-{org}-{repo}-protected
- Other refs use github-{org}-{repo}

New optional `role` input allows explicit override for backward compatibility.
Debug logging shows selected role and detection reason.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-10311-wrapperAutoRoleSelection branch from 3cddf6d to 664935d Compare February 5, 2026 09:23
@jayadeep-km-sonarsource jayadeep-km-sonarsource merged commit 545e7cf into master Feb 5, 2026
2 checks passed
@jayadeep-km-sonarsource jayadeep-km-sonarsource deleted the feat/jd/BUILD-10311-wrapperAutoRoleSelection branch February 5, 2026 13:16
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.

2 participants