File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : " Check commits can be merged"
2
+ on :
3
+ push :
4
+ branches :
5
+ - main
6
+ pull_request :
7
+
8
+ jobs :
9
+ do-not-merge-checker :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Check that there are no commits that should not be merged
14
+ uses : gsactions/commit-message-checker@v2
15
+ with :
16
+ excludeDescription : " true" # optional: this excludes the description body of a pull request
17
+ excludeTitle : " true" # optional: this excludes the title of a pull request
18
+ checkAllCommitMessages : " true" # optional: this checks all commits associated with a pull request
19
+ accessToken : ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true
20
+ # Check for message indicating that there is a commit that should
21
+ # not be merged.
22
+ pattern : ^(?!DO NOT MERGE)
23
+ flags : " i"
24
+ error : |
25
+ "This step failed because there is a commit containing the text
26
+ 'DO NOT MERGE'. Remove this commit from the branch before merging
27
+ or change the commit summary."
28
+
29
+ - uses : actions/checkout@v3
30
+
31
+ - name : Check requirements.txt for branches
32
+ shell : bash
33
+ run : |
34
+ FILE=requirements.txt
35
+ MATCH=tickets/DM-
36
+ if grep -q $MATCH $FILE
37
+ then
38
+ echo "Ticket branches found in $FILE:"
39
+ grep -n $MATCH $FILE
40
+ exit 1
41
+ fi
You can’t perform that action at this time.
0 commit comments