mirror of
https://github.com/element-hq/element-web
synced 2024-11-22 01:05:42 +03:00
Add a github action to check the base branch (#12665)
* Add a github action to check the base branch It should be very rare that we ever PR into a branch that isn't 'develop', 'staging' or a feature branch, and this will give us a failed check when stacking up PRs on top of one another until the one below it is merged. * Name workflow
This commit is contained in:
parent
e9abc55869
commit
0317755e9c
1 changed files with 16 additions and 0 deletions
16
.github/workflows/pull_request_base_branch.yaml
vendored
Normal file
16
.github/workflows/pull_request_base_branch.yaml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
name: Pull Request Base Branch
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited, synchronize]
|
||||
jobs:
|
||||
check_base_branch:
|
||||
name: Check PR base branch
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v3
|
||||
with:
|
||||
script: |
|
||||
const baseBranch = context.payload.pull_request.base.ref;
|
||||
if (!['develop', 'staging'].includes(baseBranch) && !baseBranch.startsWith('feat/')) {
|
||||
core.setFailed(`Invalid base branch: ${baseBranch}`);
|
||||
}
|
Loading…
Reference in a new issue