File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Warn on Release Branch
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened]
6
+
7
+ jobs :
8
+ warn-on-release-branch :
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - name : Check if branch name starts with "release"
13
+ id : check_branch
14
+ run : |
15
+ if [[ "${{ github.head_ref }}" == release* ]]; then
16
+ echo "branch_is_release=true" >> $GITHUB_ENV
17
+ else
18
+ echo "branch_is_release=false" >> $GITHUB_ENV
19
+ fi
20
+
21
+ - name : Post warning comment
22
+ if : env.branch_is_release == 'true'
23
+ uses : actions/github-script@v6
24
+ with :
25
+ script : |
26
+ github.rest.issues.createComment({
27
+ owner: context.repo.owner,
28
+ repo: context.repo.repo,
29
+ issue_number: context.payload.pull_request.number,
30
+ body: "⚠️ Warning: PR should be **merged** and not **rebased**."
31
+ })
You can’t perform that action at this time.
0 commit comments