Skip to content

Commit f5e48cd

Browse files
authored
Troubleshooting error status 403
1 parent 7440d60 commit f5e48cd

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ jobs:
2626
dependency-graph:
2727
name: Update Dependency Graph
2828
runs-on: ubuntu-latest # or windows-latest, or macOS-latest
29-
permissions:
30-
contents: write # this permission is needed to submit the dependency graph
3129
steps:
3230
- uses: actions/checkout@v3
3331
- uses: scalacenter/sbt-dependency-submission@v2
@@ -52,9 +50,12 @@ Example: `foo_2.13 bar_2.13`
5250
In this example the snapshot will not contain the graphs of `foo_2.13` and `bar_3`.
5351

5452
```yaml
53+
54+
## in .github/workflows/dependency-graph.md
55+
...
5556
steps:
5657
- uses: actions/checkout@v3
57-
- uses: scalacenter/sbt-dependency-submission@v1
58+
- uses: scalacenter/sbt-dependency-submission@v2
5859
with:
5960
base-dir: ./my-scala-project
6061
modules-ignore: foo_2.13 bar_3
@@ -69,4 +70,37 @@ You can enable it in `Settings` > `Code Security and Analysis`.
6970

7071
![image](https://user-images.githubusercontent.com/13123162/177736071-5bd63d3c-d338-4e51-a3c9-ad8d11e35508.png)
7172

73+
### Unexpected Status: 403
74+
75+
This error happens when the workflow does not have the right permission on the repository.
76+
77+
First you should check that the workflow is not triggered on PR from forked repositories.
78+
It should be triggered by push to the default branch.
79+
80+
```yaml
81+
## in .github/workflows/dependency-graph.md
82+
on:
83+
push:
84+
branches:
85+
- main # default branch of the project
86+
...
87+
```
88+
89+
Then check that you enabled the read and write permissions for all workflows, at the bottom of the `Settings > Actions > General` page.
90+
91+
![image](https://user-images.githubusercontent.com/13123162/179472237-bffea114-9e99-4736-83ef-00dc7f41149b.png)
92+
93+
If you do not want to enable this you can add the write permission on the `dependency-graph` workflow only:
94+
95+
```yaml
96+
## in .github/workflows/dependency-graph.md
97+
...
98+
permissions:
99+
contents: write # this permission is needed to submit the dependency graph
100+
...
101+
```
102+
103+
104+
105+
72106

0 commit comments

Comments
 (0)