Skip to content

Commit

Permalink
use app authentication instead of PAT
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmehl committed Dec 3, 2024
1 parent 60815a8 commit cab9e03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ jobs:
run: pip install github-org-manager
- name: Display information about github-org-manager
run: gh-org-mgr --version
# Make a dry run in pull requests
- name: Synchronise settings with github-org-manager (pull request, dry)
if: github.event_name == 'pull_request'
run: gh-org-mgr sync -c . --dry
# Get app private key from secrets, set as environment variable
env:
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GTHB_APP_PRIVATE_KEY }}
# Only effectively sync on main branch
- name: Configure application, add login credentials
run: sed -i "s|__GITHUB_TOKEN__|${{ secrets.GTHB_TOKEN }}|" app.yaml
- name: Synchronise settings with github-org-manager
- name: Synchronise settings with github-org-manager (main branch, prod)
if: github.ref == 'refs/heads/main'
run: gh-org-mgr sync -c .
# Get app private key from secrets, set as environment variable
env:
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GTHB_APP_PRIVATE_KEY }}
6 changes: 5 additions & 1 deletion app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@

# Personal Oauth access token with required scopes
# The current token, stored as repository secret, is owned by @mxmehl and will expire on 2025-05-02
github_token: __GITHUB_TOKEN__
# github_token:

# GitHub App (if this is set, the personal access token (github_token) will be ignored)
github_app_id: 1075380
github_app_private_key: # set as environment variable from secrets

0 comments on commit cab9e03

Please sign in to comment.