Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 1dba018

Browse files
authored
Merge pull request #7 from skx/6-exclude-archived
Exclude archived repositories by default.
2 parents 7ed45c6 + 3e56a35 commit 1dba018

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ You can run `github2mr -help` to see available options, but in brief:
7575
* Or the reverse, ignoring all personal-repositories.
7676
* You can exclude repositories by name.
7777
* You can default to cloning repositories via HTTP, instead of SSH.
78+
* By default all _archived_ repositories are excluded.
7879

7980

8081
## Other Git Hosts

main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func main() {
181181
//
182182
// Parse flags
183183
//
184+
archived := flag.Bool("archived", false, "Include archived repositories in the output?")
184185
api := flag.String("api", "https://api.github.com/", "The API end-point to use for the remote git-host.")
185186
authHeader := flag.Bool("auth-header-token", false, "Use an authorization-header including 'token' rather than 'bearer'.\nThis is required for gitbucket, and perhaps other systems.")
186187
exclude := flag.String("exclude", "", "Comma-separated list of repositories to exclude.")
@@ -360,6 +361,15 @@ func main() {
360361
//
361362
for _, repo := range all {
362363

364+
//
365+
// If the repository is archived then
366+
// skip it, unless we're supposed to keep
367+
// it.
368+
//
369+
if *repo.Archived && !*archived {
370+
continue
371+
}
372+
363373
//
364374
// The clone-type is configurable
365375
//

0 commit comments

Comments
 (0)