Skip to content

Commit 6462912

Browse files
[Internal] Move PR message validation to a separate workflow (#707)
## Changes Move PR message validation to a separate workflow ## Tests Updated title for this PR
1 parent ccf38b3 commit 6462912

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

.github/workflows/message.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Validate Commit Message
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, edited]
6+
7+
jobs:
8+
9+
validate:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Validate Tag
18+
run: |
19+
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
20+
if grep -q "tag: \"\[$TAG\]\"" .codegen/changelog_config.yml; then
21+
echo "Valid tag found: [$TAG]"
22+
else
23+
echo "Invalid or missing tag in commit message: [$TAG]"
24+
exit 1
25+
fi

.github/workflows/push.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,3 @@ jobs:
3939

4040
- name: Fail on differences
4141
run: git diff --exit-code
42-
43-
commit-message:
44-
runs-on: ubuntu-latest
45-
if: ${{ github.event_name == 'pull_request' }}
46-
steps:
47-
- name: Checkout
48-
uses: actions/checkout@v3
49-
with:
50-
fetch-depth: 0
51-
52-
- name: Validate Tag
53-
run: |
54-
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
55-
if grep -q "tag: \"\[$TAG\]\"" .codegen/changelog_config.yml; then
56-
echo "Valid tag found: [$TAG]"
57-
else
58-
echo "Invalid or missing tag in commit message: [$TAG]"
59-
exit 1
60-
fi

0 commit comments

Comments
 (0)