File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Check Commit Message for "LMCROSSITXSADEPLOY"
2
+
3
+ on :
4
+ pull_request :
5
+ types : [synchronize, opened]
6
+
7
+ jobs :
8
+ check_commit_message :
9
+ name : Check Commit Message
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Check Commit Message
14
+ id : commits
15
+ uses : actions/github-script@v6
16
+ with :
17
+ script : |
18
+ const prNumber = context.payload.pull_request.number;
19
+ const commits = await github.rest.pulls.listCommits({
20
+ owner: context.repo.owner,
21
+ repo: context.repo.repo,
22
+ pull_number: prNumber
23
+ });
24
+
25
+ let containsText = false;
26
+ for (const commitData of commits.data) {
27
+ if (commitData.commit.message.includes("LMCROSSITXSADEPLOY")) {
28
+ containsText = true;
29
+ break;
30
+ }
31
+ }
32
+
33
+ if (!containsText) {
34
+ core.setFailed("❌ Check Commit Message - Failed: At least one commit must contain the word 'LMCROSSITXSADEPLOY'.");
35
+ }
You can’t perform that action at this time.
0 commit comments