Control GitHub PR merge strategies based on source and destination branches, and repository.
GitHub PR Merge Strategy Restrictor Extension
This extension helps you control GitHub PR merge strategies based on source and destination branches and repos. Since GitHub doesn't support this feature, I built it to prevent mistakes, like using the wrong merge strategy. For example, I squash all merges except when merging to master, but sometimes I make a mistake in the flow. This extension ensures that doesn't happen. You can define rules with exact branch names, wildcards, or patterns, making it flexible for different scenarios.
Example Restriction Rules:
- You can specify exact names for the repository and branches.
- Use * to apply the rule to all repositories or branches.
- Use wildcards like company-name/* to match all repositories starting with 'company-name' or feature/* for all branches starting with 'feature/'.
- You can combine these options, such as using * for the repository, an exact name for the source branch, and a wildcard for the destination branch, or any combination of these.
Read more
Example Restriction Rules:
- You can specify exact names for the repository and branches.
- Use * to apply the rule to all repositories or branches.
- Use wildcards like company-name/* to match all repositories starting with 'company-name' or feature/* for all branches starting with 'feature/'.
- You can combine these options, such as using * for the repository, an exact name for the source branch, and a wildcard for the destination branch, or any combination of these.
Source Manifest.json
{"update_url": "https://clients2.google.com/service/update2/crx", "manifest_version": 3, "name": "GitHub PR Merge Strategy Restrictor", "version": "1.0.2", "description": "Control GitHub PR merge strategies based on source and destination branches, and repository.", "icons": { "16": "icons/icon16.png", "32": "icons/icon32.png", "48": "icons/icon48.png", "128": "icons/icon128.png" }, "permissions": [ "storage" ], "action": { "default_popup": "popup.html" }, "content_scripts": [ { "matches": [ "*://github.com/*", "*://www.github.com/*" ], "js": [ "content.js" ] } ]}
Read more