Skip to content

Add archived repository handling with include_archived config option#4

Merged
JaredHatfield merged 2 commits intomainfrom
copilot/update-handling-of-archived-repositories
Feb 25, 2026
Merged

Add archived repository handling with include_archived config option#4
JaredHatfield merged 2 commits intomainfrom
copilot/update-handling-of-archived-repositories

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Archived GitHub repositories are read-only and cannot be synced — they should be skipped by default. If a local directory exists for an archived repo while it's being ignored, it should surface as excluded-but-present.

Behavior

  • Default (include_archived unset or false): Archived repos are filtered out during the GitHub repo listing phase. Any existing local directories for them are classified as excluded-but-present and counted in that summary bucket — no new category.
  • Opt-in (include_archived: true): Archived repos are treated identically to active repos (cloned if missing, synced if present).

Changes

  • model.RepoInfo — Added IsArchived bool field.
  • config.Config — Added include_archived YAML field (*bool) and ShouldIncludeArchived() accessor (defaults false).
  • github/client.go — Reads archived from GitHub API response and populates IsArchived.
  • github/filter.goFilterRepos excludes archived repos (adding them to the excluded slice) when ShouldIncludeArchived() is false, causing the scanner to flag any present local folders as excluded-but-present.
  • docs/USAGE.md — Documents include_archived in the config table and adds an Archived Repositories behavior section.
  • docs/EXAMPLES.md — Adds example config for include_archived: true.

Example config

organization: my-org
include_archived: true  # default is false
Original prompt

Update this application to properly handle GitHub repositories that are archived. Archived repository should effectively be ignored. They cannot be modified, therefore treat them like they don't exist. When listing all of the repositories ideally filter them out at that stage so they are not even listed. If they cannot be filtered out at that stage then when they are retrieved and the details provided filter them out at that stage. Update the relevant docs to mention this behavior.

That's the default behavior, but this is a configurable setting in the yaml file. it defaults to ignoring them but can be switched on such that those repositories will be cloned down.

if the folder is present in the git repo is checked out when the repository is archived, then it will be flagged as needing to be removed based on the setting that is configured. this doesn't create a new top-level category. it falls under the folders that should not belong there being lumped into that category for the overall summary.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
Copilot AI changed the title [WIP] Update application to handle archived GitHub repositories Add archived repository handling with include_archived config option Feb 24, 2026
Copilot AI requested a review from JaredHatfield February 24, 2026 22:49
@JaredHatfield JaredHatfield marked this pull request as ready for review February 24, 2026 22:50
@JaredHatfield JaredHatfield merged commit 04f9015 into main Feb 25, 2026
3 checks passed
@JaredHatfield JaredHatfield deleted the copilot/update-handling-of-archived-repositories branch February 25, 2026 22:56
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.

2 participants