Bump actions/checkout from 3 to 4 #13
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: Auto-Approve Pull Requests to Stage | |
| on: | |
| pull_request: | |
| branches: | |
| - "dev" | |
| - "latest" | |
| jobs: | |
| auto-approve: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Generate a token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app_id: ${{ secrets.APP_ID }} | |
| private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - name: Use the token | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| run: | | |
| gh api octocat | |
| - name: Auto-approve PR | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| run: | | |
| pr_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | |
| gh pr review $pr_number --approve --body "Auto-approving this PR." | |
| - name: Merge Approved PR | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| run: | | |
| pr_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | |
| gh pr merge $pr_number --auto --merge "$pr_number" |