Update Modal client #46
Workflow file for this run
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: Approve and enable auto-merge on copybara PRs | |
| on: | |
| pull_request_target: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| branches: | |
| - main | |
| jobs: | |
| approve-copybara: | |
| name: Approve and enable auto-merge | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.pull_request.user.login == 'modal-copybara-client[bot]' }} | |
| environment: auto-approve | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| env: | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| GH_REPO: ${{ github.repository }} | |
| steps: | |
| # Use the github bot user to approve the PR, because the copybara client app was the author. | |
| - name: Auto-approve PR | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh pr --repo $GH_REPO review $PR_NUMBER --approve | |
| - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2 | |
| id: app-token-client | |
| with: | |
| app-id: ${{ vars.MODAL_COPYBARA_CLIENT_APP_ID }} | |
| private-key: ${{ secrets.MODAL_COPYBARA_CLIENT_PRIVATE_KEY }} | |
| owner: modal-labs | |
| repositories: | | |
| modal-client | |
| # Use the copybara client app to enable automerge, so that workflows on `main` can trigger on merge. | |
| - name: Enable auto-merge | |
| env: | |
| GH_TOKEN: ${{ steps.app-token-client.outputs.token }} | |
| run: gh pr --repo $GH_REPO merge $PR_NUMBER --auto --rebase |