Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GITHUB_TOKEN doesn't seem to have enough permissions #2289

Open
domoritz opened this issue Dec 22, 2022 · 0 comments
Open

GITHUB_TOKEN doesn't seem to have enough permissions #2289

domoritz opened this issue Dec 22, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@domoritz
Copy link
Contributor

domoritz commented Dec 22, 2022

My repo uses GITHUB_TOKEN but I get an error when doing a release. It happened in vega/ts-json-schema-generator#1513.

...
#### Authors: 9
[964](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:965)

[965](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:966)
- [@dependabot[bot]](https://github.com/dependabot[bot])
[966](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:967)
- [@mvanniekerkSQ](https://github.com/mvanniekerkSQ)
[967](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:968)
- [@swnf](https://github.com/swnf)
[968](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:969)
- Alexander Tømmerås ([@flugg](https://github.com/flugg))
[969](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:970)
- Arthur Fiorette ([@arthurfiorette](https://github.com/arthurfiorette))
[970](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:971)
- Dominik Moritz ([@domoritz](https://github.com/domoritz))
[971](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:972)
- Sean Keenan ([@sean9keenan](https://github.com/sean9keenan))
[972](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:973)
- Thomas ([@thomaswr](https://github.com/thomaswr))
[973](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:974)
- Thomas Riener (thomas.riener@derstandard.at)
[974](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:975)
ℹ  info      Releasing v1.2.0 to GitHub.
[975](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:976)
ℹ  info      https://github.com/vega/ts-json-schema-generator/releases/tag/v1.2.0
[976](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:977)
✔  success   Commented on PR #1512
[977](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:978)
✔  success   Commented on PR #1438
[978](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:979)
✔  success   Commented on PR #1509
[979](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:980)
✔  success   Commented on PR #1511
[980](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:981)
✔  success   Commented on PR #1489
[981](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:982)
✔  success   Commented on PR #1490
[982](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:983)
✔  success   Commented on PR #1480
[983](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:984)
✔  success   Commented on PR #1487
[984](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:985)
✔  success   Commented on PR #1493
[985](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:986)
✔  success   Commented on PR #1510
[986](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:987)
✔  success   Commented on PR #1407
[987](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:988)
✖  error     Received 404!
[988](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:989)

[989](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:990)
This usually because the GitHub token you're using doesn't have the correct permissions to the repo.
[990](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:991)

[991](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:992)
The token used with auto must have at least "write" permission to your repo (vega/ts-json-schema-generator (​[https://github.com/vega/ts-json-schema-generator​))](https://github.com/vega/ts-json-schema-generator%E2%80%8B))) to create releases and labels.
[992](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:993)

[993](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:994)
You can check the permission for you token by running "auto info".
[994](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:995)

[995](https://github.com/vega/ts-json-schema-generator/actions/runs/3759871489/jobs/6389938409#step:5:996)
Error: Process completed with exit code 1.

My GitHub actions contain the following

      - name: Create release
        run: npm run release
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The token should have enough permissions, though.

Screenshot 2022-12-22 at 14 39 36

I would expect either a more specific error and a link to https://docs.github.com/en/actions/security-guides/automatic-token-authentication that explains what to change. Also, there is a typo that I fixed in #2288

@domoritz domoritz added the bug Something isn't working label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant