Skip to content

Commit ed9355d

Browse files
authored
Merge pull request #370 from cloudfoundry/fix-github-org-automation
Separate workflow for peribolos dump
2 parents bdaa5b9 + 7760d56 commit ed9355d

File tree

2 files changed

+59
-75
lines changed

2 files changed

+59
-75
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 'Dump Github Organization Settings'
2+
on:
3+
workflow_dispatch
4+
5+
jobs:
6+
generate-peribolos-dump:
7+
runs-on: ubuntu-18.04
8+
concurrency:
9+
group: peribolos
10+
services:
11+
ghproxy:
12+
image: rkoster/ghproxy
13+
options: >-
14+
--mount type=bind,source=/etc/passwd,target=/etc/passwd,readonly
15+
--mount type=bind,source=/etc/group,target=/etc/group,readonly
16+
ports:
17+
- 8888:8888
18+
volumes:
19+
- ${{ github.workspace }}/ghproxy-cache:/cache
20+
steps:
21+
- name: ghproxy-cache
22+
uses: actions/cache@v3
23+
with:
24+
path: ${{ github.workspace }}/ghproxy-cache
25+
key: ghproxy-cache-${{ github.run_number }}
26+
restore-keys: |
27+
ghproxy-cache-
28+
- uses: actions/checkout@v3
29+
with:
30+
fetch-depth: 0 # full clone so a PR can be created if needed
31+
path: community
32+
- name: write github private key
33+
run: |
34+
echo "${GH_PRIVATE_KEY}" > private_key
35+
echo "${GH_TOKEN}" > token
36+
env:
37+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
38+
GH_PRIVATE_KEY: ${{ secrets.GH_PRIVATE_KEY }}
39+
- name: generate-peribolos-dump
40+
uses: docker://gcr.io/k8s-prow/peribolos
41+
with:
42+
entrypoint: /bin/sh
43+
# Switch back to app auth once following PR gets merged: https://github.com/kubernetes/test-infra/pull/24882
44+
# args: --dump-full --dump cloudfoundry --github-app-id=${{ secrets.GH_APP_ID }} --github-app-private-key-path=private_key > org/cloudfoundry.yml
45+
args: -c "/ko-app/peribolos --dump-full --dump cloudfoundry --github-endpoint http://ghproxy:8888 --github-token-path=token > community/org/cloudfoundry.yml"
46+
- name: Create Pull Request
47+
uses: peter-evans/create-pull-request@v4
48+
with:
49+
path: community
50+
add-paths: org/cloudfoundry.yml
51+
commit-message: Run peribolos -dump-full
52+
branch: peribolos-dump
53+
draft: true
54+
title: 'Sync org/cloudfoundry.yml with reality'
55+
body: |
56+
This PR contains a fresh peribolos dump.
57+
PR is intended for debugging. Don't merge as-is because parts of the cloudfoundry org configuration are generated from WG charters.

.github/workflows/org-management.yml

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
runs-on: ubuntu-18.04
1717
concurrency:
1818
group: peribolos
19-
outputs:
20-
peribolos-outcome: ${{ steps.peribolos.outcome }}
2119
services:
2220
ghproxy:
2321
image: rkoster/ghproxy
@@ -40,9 +38,8 @@ jobs:
4038
uses: actions/setup-python@v3
4139
with:
4240
python-version: 3.9
43-
- uses: actions/checkout@v2
41+
- uses: actions/checkout@v3
4442
with:
45-
fetch-depth: 0 # full clone so a PR can be created if needed
4643
path: community
4744
- name: Generate github org configuration
4845
run: |
@@ -57,7 +54,6 @@ jobs:
5754
GH_TOKEN: ${{ secrets.GH_TOKEN }}
5855
GH_PRIVATE_KEY: ${{ secrets.GH_PRIVATE_KEY }}
5956
- name: peribolos
60-
continue-on-error: true
6157
id: peribolos
6258
uses: docker://gcr.io/k8s-prow/peribolos
6359
with:
@@ -77,73 +73,4 @@ jobs:
7773
--fix-teams
7874
--fix-team-members
7975
--fix-team-repos
80-
--allow-repo-archival
81-
- name: debug
82-
run: |
83-
echo "steps.peribolos.outcome = ${{ steps.peribolos.outcome }}"
84-
- name: Fail on peribolos error
85-
if: ${{ steps.peribolos.outcome == 'failure' }}
86-
run: |
87-
echo "sync job failed, trigger creation of dump PR"
88-
exit 1
89-
90-
generate-peribolos-dump:
91-
needs: peribolos
92-
if: ${{ failure() && needs.peribolos.outputs.peribolos-outcome == 'failure' }} # only run on peribolos failures not on WG yaml validation errors
93-
runs-on: ubuntu-18.04
94-
concurrency:
95-
group: peribolos
96-
services:
97-
ghproxy:
98-
image: rkoster/ghproxy
99-
options: >-
100-
--mount type=bind,source=/etc/passwd,target=/etc/passwd,readonly
101-
--mount type=bind,source=/etc/group,target=/etc/group,readonly
102-
ports:
103-
- 8888:8888
104-
volumes:
105-
- ${{ github.workspace }}/ghproxy-cache:/cache
106-
steps:
107-
- name: ghproxy-cache
108-
uses: actions/cache@v3
109-
with:
110-
path: ${{ github.workspace }}/ghproxy-cache
111-
key: ghproxy-cache-${{ github.run_number }}
112-
restore-keys: |
113-
ghproxy-cache-
114-
- uses: actions/checkout@v2
115-
with:
116-
fetch-depth: 0 # full clone so a PR can be created if needed
117-
path: community
118-
- name: write github private key
119-
run: |
120-
echo "${GH_PRIVATE_KEY}" > private_key
121-
echo "${GH_TOKEN}" > token
122-
env:
123-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
124-
GH_PRIVATE_KEY: ${{ secrets.GH_PRIVATE_KEY }}
125-
- name: generate-peribolos-dump
126-
uses: docker://gcr.io/k8s-prow/peribolos
127-
with:
128-
entrypoint: /bin/sh
129-
# Switch back to app auth once following PR gets merged: https://github.com/kubernetes/test-infra/pull/24882
130-
# args: --dump-full --dump cloudfoundry --github-app-id=${{ secrets.GH_APP_ID }} --github-app-private-key-path=private_key > org/cloudfoundry.yml
131-
args: -c "/ko-app/peribolos --dump-full --dump cloudfoundry --github-endpoint http://ghproxy:8888 --github-token-path=token > community/org/cloudfoundry.yml"
132-
- name: Create Pull Request
133-
uses: peter-evans/create-pull-request@v4
134-
with:
135-
path: community
136-
add-paths: org/cloudfoundry.yml
137-
commit-message: Run peribolos -dump-full
138-
branch: peribolos-dump
139-
draft: true
140-
title: 'Sync org/cloudfoundry.yml with reality'
141-
body: |
142-
Peribolos failed to sync here: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
143-
144-
This PR contains a fresh periobos dump which once merged should resolve the sync issues.
145-
PR is intended for debugging. Don't merge as-is because parts of the cloudfoundry org configuration are generated from WG charters.
146-
- name: Fail job on sync failure
147-
run: |
148-
echo "sync job failed, dump PR created"
149-
exit 1
76+
--allow-repo-archival

0 commit comments

Comments
 (0)