Skip to content

Commit ffaef4c

Browse files
authored
fix: match behaviour for scope to the example
fix: correct scopes input env var typo
2 parents 2ee51b3 + 1c0c12b commit ffaef4c

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
steps:
4040
- name: validate pull request title
41-
uses: kontrolplane/pull-request-title-validator@v1.4.1
41+
uses: kontrolplane/pull-request-title-validator@v1.4.2
4242
```
4343
4444
### Custom types
@@ -62,7 +62,7 @@ jobs:
6262
runs-on: ubuntu-latest
6363
steps:
6464
- name: validate pull request title
65-
uses: kontrolplane/pull-request-title-validator@v1.4.1
65+
uses: kontrolplane/pull-request-title-validator@v1.4.2
6666
with:
6767
types: "fix,feat,chore"
6868
```
@@ -90,7 +90,7 @@ jobs:
9090
runs-on: ubuntu-latest
9191
steps:
9292
- name: validate pull request title
93-
uses: kontrolplane/pull-request-title-validator@v1.4.1
93+
uses: kontrolplane/pull-request-title-validator@v1.4.2
9494
with:
9595
scopes: "api,lang,parser,package/.+"
9696
```
@@ -101,5 +101,7 @@ jobs:
101101
102102
<a href="https://github.com/levivannoort"><img src="https://avatars.githubusercontent.com/u/73097785?v=4" title="levivannoort" width="50" height="50"></a>
103103
<a href="https://github.com/paopa"><img src="https://avatars.githubusercontent.com/u/52045032?v=4" title="paopa" width="50" height="50"></a>
104+
<a href="https://github.com/jlenuffpdna"><img src="https://avatars.githubusercontent.com/u/196163324?v=4" title="jlenuffpdna" width="50" height="50"></a>
105+
104106
105107
[//]: kontrolplane/generate-contributors-list

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type config struct {
1919
GithubEventName string `env:"GITHUB_EVENT_NAME"`
2020
GithubEventPath string `env:"GITHUB_EVENT_PATH"`
2121
Types string `env:"INPUT_TYPES"`
22-
Scope string `env:"INPUT_SCOPE"`
22+
Scopes string `env:"INPUT_SCOPES"`
2323
}
2424

2525
type PullRequest struct {
@@ -57,7 +57,7 @@ func main() {
5757
titleType, titleScope, titleMessage := splitTitle(logger, title)
5858

5959
parsedTypes := parseTypes(logger, cfg.Types, defaultConventionTypes)
60-
parsedScope := parseScopes(logger, cfg.Scope)
60+
parsedScopes := parseScopes(logger, cfg.Scopes)
6161

6262
if err := checkAgainstConventionTypes(logger, titleType, parsedTypes); err != nil {
6363
logger.Error("error while checking the type against the allowed types",
@@ -68,7 +68,7 @@ func main() {
6868
os.Exit(1)
6969
}
7070

71-
if err := checkAgainstScopes(logger, titleScope, parsedScope); err != nil && len(parsedScope) >= 1 {
71+
if err := checkAgainstScopes(logger, titleScope, parsedScopes); err != nil && len(parsedScopes) >= 1 {
7272
logger.Error("error while checking the scope against the allowed scopes", slog.Any("error", err))
7373
os.Exit(1)
7474
}

0 commit comments

Comments
 (0)