-
Notifications
You must be signed in to change notification settings - Fork 37
58 lines (48 loc) · 1.87 KB
/
appropriate_branch.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
name : appropriate_branch
on :
workflow_call :
inputs :
src_branch :
required : true
type : string
dst_branch :
required : true
type : string
secrets :
PRIVATE_GITHUB_BOT_TOKEN :
description : 'Github bot token'
required : true
env :
CARGO_TERM_COLOR : always
concurrency :
group : appropraite_branch_${{ inputs.src_branch }}_${{ inputs.dst_branch }}
cancel-in-progress : true
jobs :
check :
runs-on : ubuntu-latest
outputs :
shouldSkip : ${{ steps.validation.outputs.wrong-target }}
steps :
- name : Check branch
id : validation
uses : Vankka/[email protected]
env :
GITHUB_TOKEN : ${{ secrets.PRIVATE_GITHUB_BOT_TOKEN }}
with :
target : ${{ inputs.dst_branch }}
exclude : ${{ inputs.src_branch }}
comment : |
To maintain stability of the module the repository uses 3-stages system to forward changes from an unstable branch to a stable.
The unstable branch is `alpha`. All user pull requests should be opened to this branch.
The staging branch is `beta`. Changes to this branch are forwarded by a pull request from branch `alpha` automatically.
The stable branch is `master`. Changes to this branch are forwarded by a pull request from branch `beta` automatically.
The pull request was automatically converted to draft.
Please, change base branch taking into account the described system `alpha -> beta -> master`.
- name : Convert to draft
if : ${{ steps.validation.outputs.wrong-target == 'true' }}
uses: voiceflow/draft-pr@latest
with:
token: ${{ secrets.PRIVATE_GITHUB_BOT_TOKEN }}
- name : Failure
if : ${{ steps.validation.outputs.wrong-target == 'true' }}
run : exit 1