sync #174
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: sync | |
| on: | |
| schedule: | |
| # Every day at 14:12 (randomly chosen) | |
| - cron: '12 14 * * *' | |
| # Allows manual trigger | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| sync: | |
| name: sync | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/create-github-app-token@v2 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.PRIVATE_KEY }} | |
| - name: Get GitHub App User Git String | |
| id: user | |
| run: | | |
| userId=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id) | |
| name="${{ steps.app-token.outputs.app-slug }}[bot]" | |
| email="$userId+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" | |
| git config --global user.name "$name" | |
| git config --global user.email "$email" | |
| echo "git-string=$name <$email>" >> "$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Fetch source | |
| uses: actions/checkout@v4 | |
| - name: Run script | |
| run: scripts/sync.sh NixOS nixpkgs-committers members | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| author: ${{ steps.user.outputs.git-string }} | |
| committer: ${{ steps.user.outputs.git-string }} | |
| commit-message: Automated sync | |
| branch: create-pull-request/sync | |
| title: Automated sync | |
| body: This is an automated PR to sync the member list in this repository to match the GitHub team members. This PR can be merged without taking any further action. | |