Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. necojackarc renamed this gist Jan 26, 2023. 1 changed file with 0 additions and 0 deletions.
  2. necojackarc revised this gist Jan 26, 2023. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Github Cli One-liner to Add Collaborators to All Repos.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@
    - You have the permission to list all repositories in your organisation

    ```bash
    gh repo list -L 50 <organisation> | \ # 50 is the number of repositories to be listed
    # 50 is the number of repositories to be listed
    gh repo list -L 50 <organisation> | \
    awk '{print $1}' | \
    while read line; \
    do yes | gh repo-collab add $line <handle> --permission {pull|triage|push|maintain|admin};
  3. necojackarc revised this gist Jan 26, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Github Cli One-liner to Add Collaborators to All Repos.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    gh repo list -L 50 <organisation> | \ # 50 is the number of repositories to be listed
    awk '{print $1}' | \
    while read line; \
    do yes | gh repo-collab add $line '<username|team-name>' --permission <pull>;
    do yes | gh repo-collab add $line <handle> --permission {pull|triage|push|maintain|admin};
    done
    ```

  4. necojackarc renamed this gist Jan 26, 2023. 1 changed file with 0 additions and 0 deletions.
  5. necojackarc renamed this gist Jan 26, 2023. 1 changed file with 0 additions and 0 deletions.
  6. necojackarc renamed this gist Jan 26, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. necojackarc created this gist Jan 26, 2023.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    ## Conditions

    - You have [GitHub CLI](https://github.com/cli/cli) installed and logged in
    - You have [gh repo-collab extention](https://github.com/mislav/gh-repo-collab) intalled
    - You have the permission to list all repositories in your organisation

    ```bash
    gh repo list -L 50 <organisation> | \ # 50 is the number of repositories to be listed
    awk '{print $1}' | \
    while read line; \
    do yes | gh repo-collab add $line '<username|team-name>' --permission <pull>;
    done
    ```

    ## Links
    - [Add collaborators to repo #2807](https://github.com/cli/cli/issues/2807)
    - [mislav/gh-repo-collab](https://github.com/mislav/gh-repo-collab)