Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2cf52e2

Browse filesBrowse files
make it possible to update all repos of a single team in an organization
If parameters org and team are provided all repos an existing team are being looked up and updated. There is no functional change on the existing org or user parameters.
1 parent f889d0f commit 2cf52e2
Copy full SHA for 2cf52e2

File tree

Expand file treeCollapse file tree

3 files changed

+32
-14
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+32
-14
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+15-14Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,21 @@ Run with the `--verbose` flag to see debug information
5353

5454
## Options
5555

56-
| Flag | Description | Default |
57-
| ------------------------------- | -------------------------------------------------------------- | ------- |
58-
| --pat <token> | GitHub API Token | N/A |
59-
| --repo <name> | The repo to update (format: user/repo) | N/A |
60-
| --user <name> | Update all repos owned by the provided user (example: my-user) | N/A |
61-
| --org <name> | Update all repos in the provided org (example: my-org-name) | N/A |
62-
| --keep-old | Keep the old branch rather than deleting it | false |
63-
| --dry-run | Output log messages only. Do not make any changes | false |
64-
| --list-repos-only | List repos that would be affected, then exit | false |
65-
| --skip-forks | Skips forked repositories | false |
66-
| --skip-update-branch-protection | Skip updating branch protections | false |
67-
| --old | The name of the branch to rename | master |
68-
| --new | The new branch name | main |
69-
| --confirm | Run without prompting for confirmation | false |
56+
| Flag | Description | Default |
57+
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------- |
58+
| --pat <token> | GitHub API Token | N/A |
59+
| --repo <name> | The repo to update (format: user/repo) | N/A |
60+
| --user <name> | Update all repos owned by the provided user (example: my-user) | N/A |
61+
| --org <name> | Update all repos in the provided org (example: my-org-name) | N/A |
62+
| --team <name> | Update all repos in the provided team (example: my-team-name), only usable in combination with org parameter | N/A |
63+
| --keep-old | Keep the old branch rather than deleting it | false |
64+
| --dry-run | Output log messages only. Do not make any changes | false |
65+
| --list-repos-only | List repos that would be affected, then exit | false |
66+
| --skip-forks | Skips forked repositories | false |
67+
| --skip-update-branch-protection | Skip updating branch protections | false |
68+
| --old | The name of the branch to rename | master |
69+
| --new | The new branch name | main |
70+
| --confirm | Run without prompting for confirmation | false |
7071

7172
## Replacements
7273

‎bin/github-default-branch

Copy file name to clipboardExpand all lines: bin/github-default-branch
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
description:
1818
"Update all repos in the provided org (example: my-org-name)",
1919
},
20+
team: {
21+
type: "string",
22+
description:
23+
"Update all repos in the provided team (example: my-team-name), only usable in combination with org parameter",
24+
},
2025
"keep-old": {
2126
type: "boolean",
2227
default: false,

‎src/get-repos.js

Copy file name to clipboardExpand all lines: src/get-repos.js
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ module.exports = async function (args, octokit) {
1515
);
1616
}
1717

18+
if (args.org && args.team) {
19+
repos = await octokit.paginate(
20+
octokit.teams.listReposInOrg,
21+
{
22+
org: args.org,
23+
team_slug: args.team,
24+
per_page: 100
25+
},
26+
(response) => response.data
27+
);
28+
}
29+
1830
if (args.user) {
1931
repos = await octokit.paginate(
2032
octokit.repos.listForAuthenticatedUser,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.