1
1
name : Conventional commits
2
2
3
+ # This GitHub CI Action enforces that pull request titles follow conventional commits.
4
+ # More info at https://www.conventionalcommits.org.
5
+ #
6
+ # The Ory-wide defaults for commit titles and scopes are below.
7
+ # Your repository can add/replace elements via a configuration file at the path below.
8
+ # More info at https://github.com/ory/ci/blob/master/conventional_commit_config/README.md
9
+
3
10
on :
4
- pull_request_target : # enable Pull Requests from forks, uses config from master branch
5
- types : [opened, edited, reopened, ready_for_review]
11
+ pull_request_target :
12
+ types :
13
+ - edited
14
+ - opened
15
+ - ready_for_review
16
+ - reopened
6
17
# pull_request: # for debugging, uses config in local branch but supports only Pull Requests from this repo
7
18
8
19
jobs :
9
20
main :
10
21
name : Validate PR title
11
22
runs-on : ubuntu-latest
12
23
steps :
13
- - uses : amannn/action-semantic-pull-request@v4
14
- id : check-title
15
- env :
16
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
+ - uses : actions/checkout@v3
25
+ - id : config
26
+ uses : ory/ci/conventional_commit_config@master
17
27
with :
18
- types : |
28
+ config_path : .github/conventional_commits.json
29
+ default_types : |
19
30
feat
20
31
fix
21
32
revert
@@ -28,48 +39,18 @@ jobs:
28
39
security
29
40
ci
30
41
chore
31
-
32
- scopes : |
33
- blog
34
- cms
42
+ default_scopes : |
35
43
deps
36
44
docs
37
- home
38
- hydra
39
- keto
40
- kratos
41
- stats
42
-
43
- requireScope : false
44
-
45
- # Configure which scopes are disallowed in PR titles. For instance by setting
46
- # the value below, `chore(release): ...` and `ci(e2e,release): ...` will be rejected.
47
- # disallowScopes: |
48
- # release
49
-
50
- # Configure additional validation for the subject based on a regex.
51
- # This example ensures the subject doesn't start with an uppercase character.
45
+ default_require_scope : false
46
+ - uses : amannn/action-semantic-pull-request@v4
47
+ env :
48
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49
+ with :
50
+ types : ${{ steps.config.outputs.types }}
51
+ scopes : ${{ steps.config.outputs.scopes }}
52
+ requireScope : ${{ steps.config.outputs.requireScope }}
52
53
subjectPattern : ^(?![A-Z]).+$
53
-
54
- # If `subjectPattern` is configured, you can use this property to override
55
- # the default error message that is shown when the pattern doesn't match.
56
- # The variables `subject` and `title` can be used within the message.
57
54
subjectPatternError : |
58
55
The subject should start with a lowercase letter, yours is uppercase:
59
56
"{subject}"
60
-
61
- # If the PR contains one of these labels, the validation is skipped.
62
- # Multiple labels can be separated by newlines.
63
- # If you want to rerun the validation when labels change, you might want
64
- # to use the `labeled` and `unlabeled` event triggers in your workflow.
65
- # ignoreLabels: |
66
- # bot
67
- # ignore-semantic-pull-request
68
-
69
- # For work-in-progress PRs you can typically use draft pull requests
70
- # from GitHub. However, private repositories on the free plan don't have
71
- # this option and therefore this action allows you to opt-in to using the
72
- # special "[WIP]" prefix to indicate this state. This will avoid the
73
- # validation of the PR title and the pull request checks remain pending.
74
- # Note that a second check will be reported if this is enabled.
75
- # wip: true
0 commit comments