Skip to content

Commit 9d98c9a

Browse files
authored
Merge pull request #3 from getindata/feat/add-gh-validate-pr-title-workflow
feat: Add GitHub validate pr title workflow
2 parents 0b862a4 + 70e1492 commit 9d98c9a

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Validate PR title
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
release:
12+
uses: getindata/github-workflows/.github/workflows/gh-validate-pr-title.yml@main
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Validate PR title
2+
3+
on:
4+
- workflow_call
5+
6+
jobs:
7+
main:
8+
name: Validate PR title
9+
runs-on: ubuntu-latest
10+
steps:
11+
# Please look up the latest version from
12+
# https://github.com/amannn/action-semantic-pull-request/releases
13+
- uses: amannn/action-semantic-pull-request@v5
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
with:
17+
# Configure which types are allowed.
18+
# Default: https://github.com/commitizen/conventional-commit-types
19+
types: |
20+
feat
21+
fix
22+
improvement
23+
docs
24+
refactor
25+
test
26+
ci
27+
chore
28+
# Configure that a scope must always be provided.
29+
requireScope: false
30+
# Configure additional validation for the subject based on a regex.
31+
# This example ensures the subject starts with an uppercase character.
32+
subjectPattern: ^[A-Z].+$
33+
# If `subjectPattern` is configured, you can use this property to override
34+
# the default error message that is shown when the pattern doesn't match.
35+
# The variables `subject` and `title` can be used within the message.
36+
subjectPatternError: |
37+
The subject "{subject}" found in the pull request title "{title}"
38+
didn't match the configured pattern. Please ensure that the subject
39+
starts with an uppercase character.
40+
# For work-in-progress PRs you can typically use draft pull requests
41+
# from Github. However, private repositories on the free plan don't have
42+
# this option and therefore this action allows you to opt-in to using the
43+
# special "[WIP]" prefix to indicate this state. This will avoid the
44+
# validation of the PR title and the pull request checks remain pending.
45+
# Note that a second check will be reported if this is enabled.
46+
wip: true

0 commit comments

Comments
 (0)