Skip to content

Commit c98c997

Browse files
geofffranksameowlia
andcommitted
Add dry-run for github action to remove individual access to repos
Signed-off-by: Amelia Downs <[email protected]> Co-authored-by: Amelia Downs <[email protected]>
1 parent 24946d0 commit c98c997

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'Remove individual access to repos'
2+
on:
3+
push:
4+
branches:
5+
- main
6+
schedule:
7+
- cron: '0 */1 * * *'
8+
9+
permissions: read-all
10+
jobs:
11+
remove-individual-access-to-repos:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
path: community
17+
- name: Generate github org configuration
18+
env:
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: |
21+
set -e
22+
set -o pipefail
23+
24+
community/org/generate_working_group_projects_sync_config.sh | jq -r .[].repositories[].name | grep -E "^cloudfoundry/" | while read -r repo; do
25+
gh api "repos/${repo}/collaborators?affiliation=direct" | jq -r .[].login | while read -r user; do
26+
echo "remove ${user} from ${repo}"
27+
# gh api -X delete "/repos/${repo}/collaborators/${user}"
28+
done
29+
done

0 commit comments

Comments
 (0)