We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bc7d12f + 1132f7d commit 4e781d1Copy full SHA for 4e781d1
1 file changed
.github/actions/check-pr-title-format/action.yaml
@@ -0,0 +1,26 @@
1
+name: Validate PR title
2
+description: "Validate pull request title against a regex"
3
+inputs:
4
+ title:
5
+ description: "Pull request title"
6
+ required: true
7
+runs:
8
+ using: "composite"
9
+ steps:
10
+ - name: "Validate PR title"
11
+ shell: bash
12
+ env:
13
+ TITLE: ${{ inputs.title }}
14
+ run: |
15
+ title="$TITLE"
16
+ pattern='^CCM-[0-9]+: .+$'
17
+ message='PR title must match: CCM-1234: Some Text'
18
+
19
+ echo "PR title: $title"
20
21
+ if printf '%s\n' "$title" | grep -Eq -- "$pattern"; then
22
+ echo "PR title is valid"
23
+ else
24
+ echo "::error::$message"
25
+ exit 1
26
+ fi
0 commit comments