GitHub settings --> teams.yaml sync #1032
This file contains hidden or 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: GitHub settings --> teams.yaml sync | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "33 * * * *" # hourly (staggered to avoid peak load) | |
| concurrency: | |
| group: team-sync-${{ github.repository }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| export: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Mint token via GitHub app | |
| id: app-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - name: Export teams.yaml | |
| env: | |
| ORG: ${{ github.repository_owner }} | |
| TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| python -m pip install --quiet --upgrade pip | |
| python -m pip install --quiet pyyaml requests | |
| python scripts/github_to_yaml.py | |
| - name: Create PR if changed | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| commit-message: "chore: export teams.yaml" | |
| title: "[AUTO] Exporting Organization settings from GitHub" | |
| body: | |
| " The management workflow detected changes between the organization settings and the teams.yaml file. \ | |
| Exporting current team membership settings into teams.yaml. \n\n\ | |
| **Note that checks are not run by GH Actions-generated PRs.** \ | |
| You may need to close and reopen the PR to trigger checks. \n\n\ | |
| _This is an automated PR created by the management workflow._ \n\n | |
| Merging this PR will trigger the 'YAML → GitHub' sync workflow to ensure settings are up to date." | |
| branch: chore/teams-export | |
| delete-branch: true | |
| add-paths: | | |
| teams.yaml |