You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use action input instead of env var to get the github token
BREAKING CHANGE: GITHUB_TOKEN env var is now ignored. In case a custom token is needed,
it'll be necessary to pass it via the `token` input from now on.
Copy file name to clipboardExpand all lines: README.md
+14-10
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,17 @@ Lints Pull Request commits with commitlint
7
7
Create a github workflow in the `.github` folder, e.g. `.github/workflows/commitlint.yml`:
8
8
9
9
```yaml
10
-
name: Commitlint
10
+
name: Lint Commit Messages
11
11
on: [pull_request]
12
12
13
13
jobs:
14
-
lint:
14
+
commitlint:
15
15
runs-on: ubuntu-latest
16
-
env:
17
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18
16
steps:
19
17
- uses: actions/checkout@v2
20
18
with:
21
19
fetch-depth: 0
22
-
- uses: wagoid/commitlint-github-action@v1
20
+
- uses: wagoid/commitlint-github-action@v2
23
21
```
24
22
25
23
Alternatively, you can run on other event types such as `on: [push]`. In that case the action will lint the push event's commit(s) instead of linting commits from a pull request. You can also combine `push` and `pull_request` together in the same workflow.
@@ -54,6 +52,14 @@ Link to a page explaining your commit message convention.
Personal access token (PAT) used to interact with the GitHub API.
58
+
By default, the automatic token provided by GitHub is used.
59
+
You can see more info about GitHub's default token [here](https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token).
60
+
61
+
default: `${{ github.token }}`
62
+
57
63
## Outputs
58
64
59
65
### `results`
@@ -114,14 +120,12 @@ Apart from the shared configurations that are included by default, you can also
114
120
In order to do so, you can use `NODE_PATH` env var to make the action take those dependencies into account. Below is an example workflow that does that.
115
121
116
122
```yaml
117
-
name: Commitlint
123
+
name: Lint Commit Messages
118
124
on: [pull_request]
119
125
120
126
jobs:
121
-
lint:
127
+
commitlint:
122
128
runs-on: ubuntu-latest
123
-
env:
124
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125
129
steps:
126
130
- uses: actions/checkout@v2
127
131
with:
@@ -134,7 +138,7 @@ jobs:
134
138
# $GITHUB_WORKSPACE is the path to your repository
Copy file name to clipboardExpand all lines: action.yml
+10-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,9 @@ inputs:
7
7
default: './commitlint.config.js'
8
8
required: false
9
9
firstParent:
10
-
description: 'When set to true, we follow only the first parent commit when seeing a merge commit. More info in git-log docs https://git-scm.com/docs/git-log#Documentation/git-log.txt---first-parent'
10
+
description: >
11
+
When set to true, we follow only the first parent commit when seeing a merge commit.
12
+
More info in git-log docs https://git-scm.com/docs/git-log#Documentation/git-log.txt---first-parent
11
13
default: 'true'
12
14
required: false
13
15
failOnWarnings:
@@ -18,6 +20,13 @@ inputs:
18
20
description: 'Link to a page explaining your commit message convention'
Personal access token (PAT) used to interact with the GitHub API.
26
+
By default, the automatic token provided by GitHub is used.
27
+
You can see more info about GitHub's default token here: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
28
+
default: ${{ github.token }}
29
+
required: false
21
30
outputs:
22
31
results:
23
32
description: The error and warning messages for each one of the analyzed commits
0 commit comments