Skip to content

GITHUB_TOKEN does not have the correct rights to publish to private repos #21156

@scottdickerson

Description

@scottdickerson

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token

What changes are you suggesting?

We have Github workflows where we've tried to use the GITHUB_TOKEN to publish packages to github packages. These are scoped packages that point to repositories owned by our organization. We do not want to use a PAT.

We have given packages: write permissions to the Github workflows. We get 403 errors saying this token doesn' t have permissions to publish the package.
https://github.com/Contrast-Security-Inc/skeletor/actions/runs/3198674064/jobs/5223496673

This section of the documentation says that a PAT is required to write those packages:
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token

But according to this issue and blog post, reading and writing a scoped package should now be supported by adding permissions to the GITHUB_TOKEN:

https://github.blog/changelog/2022-08-31-packages-fine-grained-permissions-and-organization-level-publishing-are-now-available-for-the-github-packages-npm-registry/

actions/setup-node#49 (comment)

Can this conflicting information in the documentation be resolved and added to the original article?

Additional information

No response

Metadata

Metadata

Assignees

Labels

contentThis issue or pull request belongs to the Docs Content teamneeds SMEThis proposal needs review from a subject matter expertpackagesThis issue or pull request should be reviewed by the docs packages team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions