Skip to content

Commit a570e6e

Browse files
committed
Add --list-repos-only flag
1 parent c755d11 commit a570e6e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ Run with the `--verbose` flag to see debug information
4343

4444
## Options
4545

46-
| Flag | Description | Default |
47-
| ------------- | -------------------------------------------------------------- | ------- |
48-
| --pat <token> | GitHub API Token | N/A |
49-
| --dry-run | Output log messages only. Do not make any changes | N/A |
50-
| --repo <name> | The repo to update (format: user/repo) | N/A |
51-
| --user <name> | Update all repos owned by the provided user (example: my-user) | N/A |
52-
| --org <name> | Update all repos in the provided org (example: my-org-name) | N/A |
53-
| --keep-old | Keep the old branch rather than deleting it | false |
54-
| --old | The name of the branch to rename | master |
55-
| --new | The new branch name | main |
46+
| Flag | Description | Default |
47+
| ----------------- | -------------------------------------------------------------- | ------- |
48+
| --pat <token> | GitHub API Token | N/A |
49+
| --repo <name> | The repo to update (format: user/repo) | N/A |
50+
| --user <name> | Update all repos owned by the provided user (example: my-user) | N/A |
51+
| --org <name> | Update all repos in the provided org (example: my-org-name) | N/A |
52+
| --keep-old | Keep the old branch rather than deleting it | false |
53+
| --dry-run | Output log messages only. Do not make any changes | false |
54+
| --list-repos-only | List repos that would be affected, then exit | false |
55+
| --old | The name of the branch to rename | master |
56+
| --new | The new branch name | main |

bin/github-default-branch

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353

5454
const repos = await getRepos(argv, octokit);
5555

56+
if (argv.listReposOnly) {
57+
console.log(repos.join("\n"));
58+
return;
59+
}
60+
5661
const old = argv.old || "master";
5762
const target = argv.new || "main";
5863

0 commit comments

Comments
 (0)