Skip to content

Commit

Permalink
Add app to generate token (#1)
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Wang <[email protected]>
  • Loading branch information
huiwangredhat committed Oct 14, 2024
1 parent 9cf7b97 commit bac213c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/apply_peribolos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Copy peribolos.yaml
run: |
cp peribolos.yaml /tmp
run: cp peribolos.yaml /tmp

- name: Checkout ghproxy and peribolos code
if: ${{ github.repository_owner == 'complytime' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
Expand All @@ -42,15 +41,24 @@ jobs:
go mod tidy
go build -o .
cp peribolos /tmp
- name: Generate a app token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Apply peribolos.yaml
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
if: ${{ github.repository_owner == 'complytime' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
echo ${{ secrets.orgtoken }} > auth.txt
echo $GITHUB_TOKEN > auth.txt
/tmp/ghproxy --legacy-disable-disk-cache-partitions-by-auth-header=false --get-throttling-time-ms=300 --throttling-time-ms=900 --throttling-time-v4-ms=850 --throttling-max-delay-duration-seconds=45 --throttling-max-delay-duration-v4-seconds=110 --request-timeout=120 1>/dev/null 2>&1 &
pid=$!
jobs
/tmp/peribolos -config-path /tmp/peribolos.yaml --fix-org --fix-org-members --fix-repos --github-token-path /tmp/org-token --github-endpoint http://localhost:8888 --confirm 2>&1 | jq -r '[.severity, .time, .msg] | join(" | ")'
/tmp/peribolos -config-path /tmp/peribolos.yaml --fix-org --fix-org-members --fix-repos -min-admins 2 --github-token-path /tmp/org-token 2>&1 | jq -r '[.severity, .time, .msg] | join(" | ")'
kill $pid
rm auth.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This repository will apply peribolos to manage org complytime.
This repository will apply peribolos to manage orgnization complytime.
4 changes: 2 additions & 2 deletions peribolos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ orgs:
has_repository_projects: true
members_can_create_repositories: true
admins:
- beatrizmcouto
- jpower432
- jflowers
members:
- beatrizmcouto
- d10n
- gvauter
- hbraswelrh
- huiwangredhat
- jflowers
repos:
".github":
default_branch: main
Expand Down

0 comments on commit bac213c

Please sign in to comment.