Add support for archiving GitHub mirrors automatically based on "archived" API parameter on the remote repo #11957

Open
opened 2025-11-02 09:52:52 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @kbdharun on GitHub (Nov 5, 2023).

Feature Description

Currently, there isn't an archive option for mirror repositories (and it is available for only regular ones as far as I can remember).

It would be great if Gitea could read the "archived" parameter from the GitHub mirror's remote API configuration during sync. If the archive value is set to true then the mirror can be archived automatically.

Once the mirror is archived, we can continue to query the API alone (while disabling other sync operations) to check if the repo has been unarchived. If the repo has been unarchived, the mirror can also be unarchived (and repo sync can be done as set).


Examples

  1. Example archived repo with archived parameter set to "true" in the API.
  2. Example normal repo with archived parameter set to "false" in the API.

Screenshots

No response

Originally created by @kbdharun on GitHub (Nov 5, 2023). ### Feature Description Currently, there isn't an archive option for mirror repositories (and it is available for only regular ones as far as I can remember). It would be great if Gitea could read the "archived" parameter from the GitHub mirror's remote API configuration during sync. If the archive value is set to true then the mirror can be archived automatically. Once the mirror is archived, we can continue to query the API alone (while disabling other sync operations) to check if the repo has been unarchived. If the repo has been unarchived, the mirror can also be unarchived (and repo sync can be done as set). ---- ## Examples 1. [Example archived repo](https://github.com/kbdharun/Java-Programs) with archived parameter set to "true" in the [API](https://api.github.com/repos/kbdharun/Java-Programs). 2. [Example normal repo](https://github.com/tldr-pages/tldr) with archived parameter set to "false" in the [API](https://api.github.com/repos/tldr-pages/tldr). ---- ### Screenshots _No response_
GiteaMirror added the topic/apitype/proposal labels 2025-11-02 09:52:52 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Nov 5, 2023):

I don't think this will work reliable. The default mirror interval is 8h. If you unarchive, change files and re-archive a repo on Github inbetween this time slot, Gitea never sees a change.

And after the migration we don't know the source type of the mirror anymore because only the git remote data is needed.

@KN4CK3R commented on GitHub (Nov 5, 2023): I don't think this will work reliable. The default mirror interval is 8h. If you unarchive, change files and re-archive a repo on Github inbetween this time slot, Gitea never sees a change. And after the migration we don't know the source type of the mirror anymore because only the git remote data is needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11957