GHA-163 Add Lock Branch Action to manage branch protection settings#81
Merged
nils-werner-sonarsource merged 10 commits intomasterfrom Feb 4, 2026
Merged
GHA-163 Add Lock Branch Action to manage branch protection settings#81nils-werner-sonarsource merged 10 commits intomasterfrom
nils-werner-sonarsource merged 10 commits intomasterfrom
Conversation
14f81e5 to
05bd836
Compare
yasen-pavlov-sonarsource
approved these changes
Feb 4, 2026
Contributor
yasen-pavlov-sonarsource
left a comment
There was a problem hiding this comment.
LGTM! 🚀 Left one small comment regarding the payload for the PUT request
…and sensible defaults
…or branch protection defaults
SonarQube reviewer guideSummary: Adds a new "Lock Branch" GitHub Action that enables locking/unlocking branches by modifying branch protection rules, with complete implementation, tests, and CI workflow integration. Review Focus:
Start review at:
|
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.




This pull request introduces a new reusable GitHub Action called "Lock Branch" that enables locking or unlocking a branch by modifying the
lock_branchsetting in branch protection rules. The implementation includes the action logic, Slack notification integration, documentation, and automated testing workflow.Key additions and changes:
Lock Branch Action Implementation:
lock-branch/that can lock or unlock a branch via the GitHub API, preserving existing branch protection settings. The action supports Slack notifications and secure token handling via Vault. [1] [2] [3] [4]Documentation:
lock-branch/README.mdwith detailed usage instructions, prerequisites, behavior, and error handling for the new action.README.mdto document the new "Lock Branch" action and its workflow.CI/CD and Testing:
.github/workflows/test-lock-branch.ymlto run unit tests for the lock-branch action, and registered it in the main test workflow. [1] [2]