Skip to content

Commit cac8a9f

Browse files
Merge pull request #19 from codefresh-io/CR-7081-add-pr-default-branch-check
add pr-check github action
2 parents 1b6fc64 + c22de30 commit cac8a9f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "release-*"
7+
8+
jobs:
9+
test-default-branch:
10+
name: base branch is a default branch
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: fail if base branch is not default branch
14+
if: ${{ github.event.pull_request.base.ref != github.event.repository.default_branch }}
15+
uses: actions/github-script@v3
16+
with:
17+
script: |
18+
core.setFailed("Base branch of the PR - ${{ github.event.pull_request.base.ref }} is not a default branch. Please reopen your PR to ${{ github.event.repository.default_branch }}")

0 commit comments

Comments
 (0)