Skip to content

Commit

Permalink
Add app to generate token (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
huiwangredhat authored Oct 14, 2024
1 parent 9cf7b97 commit b4350dc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/apply_peribolos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,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 --github-endpoint --confirm 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 b4350dc

Please sign in to comment.