-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 2.17 KB
/
pr-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: PRCheck
on:
pull_request_target:
types: [opened, edited, reopened]
permissions:
contents: read
pull-requests: write
jobs:
pr-check-main:
name: Close PR (no merge to main except from develop or release branches)
if: ${{ !startsWith(github.head_ref, 'release-please--branches--main') && github.base_ref == 'main' && github.head_ref != 'develop' }}
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment: |
🚨 🚨 🚨
Merging the `${{ github.head_ref }}` branch into `main` is not allowed.
Only `develop` (and release branches) can be merged into `main`.
**This pull request will be closed**❗️
pr-check-gh-pages:
name: Close PR (no PR to gh-pages)
if: github.base_ref == 'gh-pages'
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment: |
🚨 🚨 🚨
No pull request are allowed to be merged into `gh-pages`.
**This pull request will be closed**❗️
pr-check-main-gh-pages:
name: Close PR (no merge from gh-pages to develop)
if: ${{ github.base_ref == 'develop' && github.head_ref == 'gh-pages' }}
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment: |
🚨 🚨 🚨
Merging the `${{ github.head_ref }}` branch into `develop` is not allowed.
**This pull request will be closed**❗️
pr-check-main-develop:
name: Close PR (no merge from main to develop)
if: ${{ github.base_ref == 'develop' && github.head_ref == 'main' }}
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment: |
🚨 🚨 🚨
Merging the `${{ github.head_ref }}` branch into `develop` is not allowed.
**This pull request will be closed**❗️