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
Copy file name to clipboardExpand all lines: README.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,20 +32,42 @@ name: Conventional Commitlint
32
32
33
33
on:
34
34
push:
35
-
branches: ['main']
35
+
branches: ["main"]
36
36
pull_request:
37
37
38
38
jobs:
39
39
commitlint:
40
40
runs-on: ubuntu-latest
41
41
name: Conventional Commitlint
42
+
permissions:
43
+
contents: read
44
+
pull-requests: read
42
45
steps:
43
46
- name: Conventional Commitlint
44
47
uses: opensource-nepal/commitlint@v1
45
48
```
46
49
47
50
> **_Note:_** The `commitlint` GitHub Action is triggered only by `push`, `pull_request`, or `pull_request_target` events.
48
51
52
+
#### GitHub Action Permissions
53
+
54
+
The action requires read permission for the following scopes:
55
+
56
+
- `contents: read` : This allows the action to list commits of the repository.
57
+
- `pull-requests: read` : This allows the action to list the commits in a Pull Request.
58
+
59
+
For public repositories, these permissions are granted by default.
60
+
For private repositories, you must explicitly grant them, either in:
61
+
62
+
- the [repository’s default workflow permissions](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions), or
63
+
- the [workflow/job permissions block](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions)
64
+
65
+
Without these, you may encounter an error like:
66
+
67
+
```
68
+
Github API failed with status code 403. Response: {'message': 'Resource not accessible by integration', 'documentation_url': 'https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request', 'status': '403'}
0 commit comments