Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Add GitHub script to give teams access to a list of repos #555

Merged
merged 2 commits into from
Jan 23, 2023

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Jan 11, 2023

What

Add GitHub script to give teams access to a list of repos

See poetry run pontos-github-script scripts/github/team-repositories.py --help for usage of the script.

To assign a list of repositories the search-repositories.py and team-repositories.py scripts can be combined. For example to add devops with read permissions to all gos repos

pontos-github-script scripts/github/search-repositories.py --organization greenbone --in-name --columns name --format csv gos | pontos-github-script scripts/github/team-repositories.py --teams devops --repositories-file - --permission pull

The search-repositories.py prints all found repository names to stdout by displaying only the name column --columns name and the output format CSV --format csv. The found repository names are piped to stdin of team-repositories.py which reads this names from stdin via --repositories-file -.

Why

Automation of changing permissions on our repos.

References

GHS-46

Checks

  • Tested

@bjoernricks bjoernricks requested a review from a team as a code owner January 11, 2023 15:40
@bjoernricks bjoernricks enabled auto-merge (rebase) January 11, 2023 15:41
@y0urself y0urself force-pushed the team-repositories-script branch from d85b500 to 7f256a2 Compare January 17, 2023 08:18
@y0urself
Copy link
Member

Do you want to add the repository wildcard here?

@bjoernricks bjoernricks force-pushed the team-repositories-script branch from 7f256a2 to 1fff8ec Compare January 17, 2023 10:11
@bjoernricks bjoernricks disabled auto-merge January 17, 2023 10:19
@bjoernricks bjoernricks enabled auto-merge January 17, 2023 10:20
See `poetry run pontos-github-script scripts/github/team-repositories.py --help`
for usage of the script.
Drop matching for teams and expect an existing list of teams as
`--teams` argument instead.
@y0urself y0urself force-pushed the team-repositories-script branch from 1fff8ec to 6dd80ea Compare January 20, 2023 10:18
auto-merge was automatically disabled January 23, 2023 06:10

Merge commits are not allowed on this repository

@y0urself y0urself merged commit 1e39e86 into main Jan 23, 2023
@y0urself y0urself deleted the team-repositories-script branch January 23, 2023 06:11
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