Updating the GitHub auth_token in the repo's Mirror Settings using the API #12976

Closed
opened 2025-11-02 10:26:49 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @TBXark on GitHub (May 9, 2024).

Feature Description

Hi,

I recently developed a tool called github-backup to synchronize GitHub repositories in batches to my own instance of Gitea. When it comes to synchronizing private repositories, I utilized an authentication token from GitHub in my calls to /api/v1/repos/migrate.

However, I encountered an issue where I couldn't find an API endpoint that allows updating this authentication token. Specifically, the token parameter was absent from the documentation for the [PATCH] /repositories/{owner}/{repo} endpoint.

Does this mean that when my token expires, I would have to delete all the repositories and recreate their mirrors?

I kindly suggest adding the ability to modify "Mirror Settings" in the [PATCH] /repositories/{owner}/{repo} endpoint, which would include the option to update the authentication token.

Thank you for your attention to this matter.

Thanks

Screenshots

No response

Originally created by @TBXark on GitHub (May 9, 2024). ### Feature Description Hi, I recently developed a tool called [github-backup](https://github.com/TBXark/github-backup) to synchronize GitHub repositories in batches to my own instance of Gitea. When it comes to synchronizing private repositories, I utilized an authentication token from GitHub in my calls to `/api/v1/repos/migrate`. However, I encountered an issue where I couldn't find an API endpoint that allows updating this authentication token. Specifically, the token parameter was absent from the documentation for the` [PATCH] /repositories/{owner}/{repo}` endpoint. Does this mean that when my token expires, I would have to delete all the repositories and recreate their mirrors? I kindly suggest adding the ability to modify "Mirror Settings" in the `[PATCH] /repositories/{owner}/{repo}` endpoint, which would include the option to update the authentication token. Thank you for your attention to this matter. Thanks ### Screenshots _No response_
GiteaMirror added the type/proposal label 2025-11-02 10:26:49 -06:00
Author
Owner

@TBXark commented on GitHub (May 11, 2024):

Reading through the source code I found that /{OWNER}/{REPO}/settings could change the token, but I was never able to authorize the request successfully. So I wrote the gitea-mirror-reauth tool to solve this problem.

@TBXark commented on GitHub (May 11, 2024): Reading through the source code I found that `/{OWNER}/{REPO}/settings` could change the token, but I was never able to authorize the request successfully. So I wrote the [gitea-mirror-reauth](https://github.com/TBXark/gitea-mirror-reauth) tool to solve this problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12976