-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ECO-2116] Add a branch protection rule to only allow merging to `pro…
…duction` from `main` (#209) Co-authored-by: matt <[email protected]>
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# yamllint disable rule:empty-lines rule:key-ordering | ||
--- | ||
name: 'Production Branch Protection' | ||
|
||
"on": | ||
pull_request: | ||
types: | ||
- 'opened' | ||
- 'reopened' | ||
- 'synchronize' | ||
- 'edited' | ||
|
||
jobs: | ||
production-branch-protection: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: 'Check if the PR is targeting the production branch' | ||
id: 'check_branch' | ||
if: | | ||
github.base_ref == 'production' && github.head_ref != 'main' | ||
run: | | ||
echo ERROR: You can only merge to the production branch from main. | ||
exit 1 | ||
... |
This file contains 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