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

Update instructions for GitHub API tokens #406

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

kini
Copy link
Contributor

@kini kini commented Jul 3, 2024

In late 2022, GitHub introduced a new type of API tokens that are supposed to be more secure and fine grained than the old type of tokens. But they won't work for nixpkgs-review's purposes (at least for now) because there is no way to grant these new tokens access to resources that are not owned by you, and most users of nixpkgs-reviews are not owners of @NixOS/nixpkgs which is the repo they're trying to submit pull request comments to (when using --post-result, anyway).

This commit clarifies the README instructions so that users will know they need to create the old type of API token, the "personal access token (classic)", and not the new type.

Also did a bit of rewording for further clarity.

@kini kini force-pushed the update-github-api-token-instructions branch from 4413c67 to 430ddca Compare July 3, 2024 02:25
README.md Outdated Show resolved Hide resolved
README.md Outdated
Comment on lines 229 to 230
Otherwise, you'll have to manually create a "personal access token (classic)"
through the GitHub website. See [the GitHub documentation][3] for
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Otherwise, you'll have to manually create a "personal access token (classic)"
through the GitHub website. See [the GitHub documentation][3] for
Otherwise, you'll have to create a "personal access token (classic)"
through GitHub's website. See [the GitHub documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic) for

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@kini kini force-pushed the update-github-api-token-instructions branch from 430ddca to 8b1f30a Compare July 3, 2024 17:01
asymmetric added a commit to asymmetric/nixpkgs-review that referenced this pull request Sep 18, 2024
SuperSandro2000 added a commit that referenced this pull request Sep 18, 2024
* doc: mention that only classic PATs work

Minimal version of #406

* doc: update example token

PATs have a `ghp_` prefix now.

* doc: fix formatting

Co-authored-by: Sandro <[email protected]>

---------

Co-authored-by: Sandro <[email protected]>
@asymmetric
Copy link
Contributor

Can this be closed now?

@kini
Copy link
Contributor Author

kini commented Sep 19, 2024

Why? There are still plenty of changes in it that weren't uptaken in 2beefeb.

@kini kini force-pushed the update-github-api-token-instructions branch from 8b1f30a to 73ea2b2 Compare September 19, 2024 09:46
@kini
Copy link
Contributor Author

kini commented Sep 19, 2024

Rebased on top of 2beefeb. I'd appreciate it if someone could reply to the pending review comments above.

In late 2022, GitHub [introduced][1] a new type of API tokens that are supposed
to be more secure and fine grained than the old type of tokens.  But they won't
work for nixpkgs-review's purposes (at least for now) because there is no way to
grant these new tokens access to resources that are not owned by you, and most
users of nixpkgs-reviews are not owners of @NixOS/nixpkgs which is the repo
they're trying to submit pull request comments to (when using `--post-result`,
anyway).

This commit clarifies the README instructions so that users will know they need
to create the old type of API token, the "personal access token (classic)", and
not the new type.

Also did a bit of rewording for further clarity.

[1]: https://github.blog/2022-10-18-introducing-fine-grained-personal-access-tokens-for-github/
@Mic92 Mic92 force-pushed the update-github-api-token-instructions branch from 4cef96c to 86940d1 Compare September 19, 2024 12:42
@Mic92
Copy link
Owner

Mic92 commented Sep 19, 2024

@mergify queue

Copy link
Contributor

mergify bot commented Sep 19, 2024

queue

🛑 The pull request has been removed from the queue default

The pull request #406 has been manually updated.

You can take a look at Queue: Embarked in merge queue check runs for more details.

In case of a failure due to a flaky test, you should first retrigger the CI.
Then, re-embark the pull request into the merge queue by posting the comment
@mergifyio refresh on the pull request.

@Mic92 Mic92 merged commit 165c940 into Mic92:master Sep 23, 2024
3 checks passed
@kini kini deleted the update-github-api-token-instructions branch October 5, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants