-
-
Notifications
You must be signed in to change notification settings - Fork 26
53 lines (49 loc) · 1.89 KB
/
prevent-merging-feature.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
name: Block Merging Feature Changes to patch release
on:
pull_request:
branches: [ master, master-* ]
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
block-feature-for-patch-release:
if: ${{ ! github.event.pull_request.draft }}
runs-on: ubuntu-latest
env:
# patch release
IS_PATCH: |
${{
contains(github.event.pull_request.labels.*.name, 'documentation')
|| contains(github.event.pull_request.labels.*.name, 'localization')
|| contains(github.event.pull_request.labels.*.name, 'bug')
|| contains(github.event.pull_request.labels.*.name, 'problem')
|| contains(github.event.pull_request.labels.*.name, 'ci')
|| contains(github.event.pull_request.labels.*.name, 'refactor')
|| contains(github.event.pull_request.labels.*.name, 'improvement')
|| ''
}}
# minor release
IS_FEATURE: ${{ contains(github.event.pull_request.labels.*.name, 'enhancement') || '' }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check for patch or feature release tag
if: ${{ !(env.IS_PATCH || env.IS_FEATURE) }}
run: |
echo "::error::either patch or feature release must be specified"
exit 1
- uses: actions/checkout@v4
if: env.IS_FEATURE
- uses: anatawa12/something-releaser@v2
if: env.IS_FEATURE
- name: Check current release is minor release
if: env.IS_FEATURE
run: |
case "$(get-version)" in
*.0-* )
echo "it's feature release. OK."
exit 0
;;
*)
echo "::error::CHANGELOG.md is not updated!"
exit 1
;;
esac