Synchronise organization settings #373
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Synchronise organization settings | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
# Synchronise once per day | |
schedule: | |
- cron: "25 3 * * *" | |
jobs: | |
sync-settings: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install github-org-manager | |
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: 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 }} |