Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use app authentication instead of PAT #38

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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