Skip to content

Commit 55f5cdd

Browse files
committed
Merge branch 'main' into remove-metric-store-members
2 parents fbbab0a + 4d9db90 commit 55f5cdd

18 files changed

+780
-548
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Delete Inactive Users in Github Organization'
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- "add-inactive-user-removal-automation"
10+
11+
jobs:
12+
org-config-generation-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: 3.9
18+
- uses: actions/checkout@v4
19+
with:
20+
path: community
21+
- name: Clean inactive github org users
22+
id: uds
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -r community/org/requirements.txt
26+
python community/org/org_user_management.py
27+
env:
28+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
29+
INACTIVE_USER_MANAGEMENT_TAG_USERS: ${{ secrets.INACTIVE_USER_MANAGEMENT_TAG_USERS }}
30+
- name: Create Pull Request
31+
if: ${{ steps.uds.outputs.inactive_users_pr_description }}
32+
uses: peter-evans/create-pull-request@v5
33+
with:
34+
path: community
35+
add-paths: org/contributors.yml
36+
commit-message: Delete inactive users
37+
branch: delete-inactive-users
38+
title: 'Inactive users to be deleted'
39+
body: ${{ steps.uds.outputs.inactive_users_pr_description }}

.github/workflows/org-management-check-prs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
org-config-generation-check:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/setup-python@v4
13+
- uses: actions/setup-python@v5
1414
with:
1515
python-version: 3.9
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
path: community
1919
- name: Generate github org configuration

.github/workflows/org-management-peribolos-dump.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
- ${{ github.workspace }}/ghproxy-cache:/cache
2020
steps:
2121
- name: ghproxy-cache
22-
uses: actions/cache@v3
22+
uses: actions/cache@v4
2323
with:
2424
path: ${{ github.workspace }}/ghproxy-cache
2525
key: ghproxy-cache-${{ github.run_number }}
2626
restore-keys: |
2727
ghproxy-cache-
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
with:
3030
fetch-depth: 0 # full clone so a PR can be created if needed
3131
path: community
@@ -44,7 +44,7 @@ jobs:
4444
# args: --dump-full --dump cloudfoundry --github-app-id=${{ secrets.GH_APP_ID }} --github-app-private-key-path=private_key > org/cloudfoundry.yml
4545
args: -c "/ko-app/peribolos --dump-full --dump cloudfoundry --github-endpoint http://ghproxy:8888 --github-token-path=token > community/org/cloudfoundry.yml"
4646
- name: Create Pull Request
47-
uses: peter-evans/create-pull-request@v4
47+
uses: peter-evans/create-pull-request@v5
4848
with:
4949
path: community
5050
add-paths: org/cloudfoundry.yml

.github/workflows/org-management.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- 'toc/working-groups/*.md'
1010
- '.github/workflows/org-management.yml'
1111
schedule:
12-
- cron: '0 */5 * * *'
12+
- cron: '0 */7 * * *'
1313

1414
jobs:
1515
peribolos:
@@ -28,16 +28,16 @@ jobs:
2828
- ${{ github.workspace }}/ghproxy-cache:/cache
2929
steps:
3030
- name: ghproxy-cache
31-
uses: actions/cache@v3
31+
uses: actions/cache@v4
3232
with:
3333
path: ${{ github.workspace }}/ghproxy-cache
3434
key: ghproxy-cache-${{ github.run_number }}
3535
restore-keys: |
3636
ghproxy-cache-
37-
- uses: actions/setup-python@v4
37+
- uses: actions/setup-python@v5
3838
with:
3939
python-version: 3.9
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141
with:
4242
path: community
4343
- name: Generate github org configuration
@@ -73,6 +73,47 @@ jobs:
7373
--fix-team-members
7474
--fix-team-repos
7575
--allow-repo-archival
76+
branchprotector:
77+
needs: peribolos
78+
runs-on: ubuntu-latest
79+
concurrency:
80+
group: peribolos
81+
services:
82+
ghproxy:
83+
image: rkoster/ghproxy
84+
options: >-
85+
--mount type=bind,source=/etc/passwd,target=/etc/passwd,readonly
86+
--mount type=bind,source=/etc/group,target=/etc/group,readonly
87+
ports:
88+
- 8888:8888
89+
volumes:
90+
- ${{ github.workspace }}/ghproxy-cache:/cache
91+
steps:
92+
- name: ghproxy-cache
93+
uses: actions/cache@v4
94+
with:
95+
path: ${{ github.workspace }}/ghproxy-cache
96+
key: ghproxy-cache-${{ github.run_number }}
97+
restore-keys: |
98+
ghproxy-cache-
99+
- uses: actions/setup-python@v5
100+
with:
101+
python-version: 3.9
102+
- uses: actions/checkout@v4
103+
with:
104+
path: community
105+
- name: Generate github org configuration
106+
run: |
107+
python -m pip install --upgrade pip
108+
pip install -r community/org/requirements.txt
109+
python community/org/org_management.py -o cloudfoundry.out.yml -b branchprotection.out.yml
110+
- name: write github private key
111+
run: |
112+
echo "${GH_PRIVATE_KEY}" > private_key
113+
echo "${GH_TOKEN}" > token
114+
env:
115+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
116+
GH_PRIVATE_KEY: ${{ secrets.GH_PRIVATE_KEY }}
76117
- name: branchprotector
77118
id: branchprotector
78119
uses: docker://gcr.io/k8s-prow/branchprotector

.github/workflows/project-sync.yml

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

0 commit comments

Comments
 (0)