Allow for a personal token to be specified for self-updates (#5568)

* Allow for a personal token to be specified for self-updates

This change will allow for setting the $GITHUB_ACCESS_TOKEN environment variable with a Github personal access token, allowing e.g. for higher rate limits

* Refactor github request and add test

---------

Co-authored-by: Paulo Saraiva <pauloman@cern.ch>
This commit is contained in:
Paulo Saraiva
2025-11-17 21:39:39 +01:00
committed by GitHub
parent 3826167474
commit c1a89d5150
4 changed files with 71 additions and 9 deletions

View File

@@ -0,0 +1,8 @@
Enhancement: Allow Github personal access token to be specified for `self-update`
`restic self-update` previously only used unauthenticated GitHub API requests when checking for the latest release. This caused some users sharing IP addresses to hit the GitHub rate limit, resulting in a 403 Forbidden error and preventing updates.
Restic still uses unauthenticated requests by default, but it now optionally supports authenticated GitHub API requests during `self-update`. Users can set the `$GITHUB_ACCESS_TOKEN` environment variable to use a [personal access token](https://github.com/settings/tokens) for this effect, avoiding update failures due to rate limiting.
https://github.com/restic/restic/issues/3738
https://github.com/restic/restic/pull/5568