Skip to content

Commit a582e29

Browse files
authored
chore: Add PR title validation Github workflow (#80)
## Problem Sometimes PRs are posted not following the [Conventional Commits spec](https://www.conventionalcommits.org/) so that we can use [`semantic-release`](https://github.com/semantic-release/semantic-release). We need to verify the PR titles and fail the PR if the title doesn't pass. ## Solution Created a new Github workflow that uses the [`semantic-pull-request` Github action](https://github.com/marketplace/actions/semantic-pull-request) that validates the PR title on creation, edit, and synchronization.
1 parent b4d1465 commit a582e29

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on: [push, pull_request]
44

55
jobs:
6-
test:
6+
main:
77
name: Test (Node ${{ matrix.node }})
88
runs-on: ubuntu-latest
99

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Format files
1+
name: Format
22

33
on:
44
push:
@@ -10,7 +10,7 @@ on:
1010
- master
1111

1212
jobs:
13-
prettier:
13+
main:
1414
name: Format files
1515
runs-on: ubuntu-latest
1616

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
- master
77

88
jobs:
9-
release:
10-
name: Release
9+
main:
10+
name: NPM Release
1111
runs-on: ubuntu-latest
1212

1313
steps:

.github/workflows/validate-pr.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Pull Request
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
9+
jobs:
10+
main:
11+
name: Validate PR
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Validate Pull Request title
16+
uses: amannn/action-semantic-pull-request@v1.1.1
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)