Add Whisperers to All Repos #50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ABOUTME: Scheduled workflow that ensures whisperers team has read access to all repos. | |
| # ABOUTME: Runs hourly and on-demand to add the team to any repos missing it. | |
| name: Add Whisperers to All Repos | |
| on: | |
| schedule: | |
| - cron: "0 * * * *" | |
| workflow_dispatch: | |
| jobs: | |
| add-whisperers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add whisperers team to all repos | |
| env: | |
| GH_TOKEN: ${{ secrets.ORG_ADMIN_TOKEN }} | |
| run: | | |
| gh repo list alltuner --limit 1000 --json name --jq '.[].name' | while read -r repo; do | |
| echo "Adding whisperers to $repo" | |
| gh api \ | |
| --method PUT \ | |
| "/orgs/alltuner/teams/whisperers/repos/alltuner/$repo" \ | |
| -f permission=pull || echo "Failed for $repo, continuing..." | |
| done |