blob: cb49ffbcd9f410caa90eccbe928d4ec3a67bf940 [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001name: Check PRs if on staging
2on:
3 pull_request_target:
4 types: [opened, edited]
5permissions: {}
6
7jobs:
8 is_not_staging:
9 runs-on: ubuntu-latest
10 if: github.event.pull_request.base.ref != 'staging' #check if the target branch is not staging
11 steps:
12 - name: Send message
13 uses: thollander/actions-comment-pull-request@main
14 with:
15 GITHUB_TOKEN: ${{ secrets.CHECKIFPRISSTAGING_ACTION_PAT }}
16 message: |
17 Thanks for contributing!
18
19 I noticed that you didn't select `staging` as your base branch. Please change the base branch to `staging`.
20 See the attached picture on how to change the base branch to `staging`:
21
22 ![check_prs_if_on_staging.png](https://raw.githubusercontent.com/mailcow/mailcow-dockerized/master/.github/workflows/assets/check_prs_if_on_staging.png)
23
24 - name: Fail #we want to see failed checks in the PR
25 if: ${{ success() }} #set exit code to 1 even if commenting somehow failed
26 run: exit 1
27
28 is_staging:
29 runs-on: ubuntu-latest
30 if: github.event.pull_request.base.ref == 'staging' #check if the target branch is staging
31 steps:
32 - name: Success
33 run: exit 0