chore(deps): bump actions/create-github-app-token from 2 to 3 in the github-actions group #20
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: dependabot | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| repository-projects: read | |
| jobs: | |
| build: | |
| name: π§ Rebuild TypeScript | |
| if: github.actor == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'javascript') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate token | |
| id: generate | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| app-id: ${{ vars.AUTOMATION_APP_ID }} | |
| private-key: ${{ secrets.AUTOMATION_APP_KEY }} | |
| - uses: actions/checkout@main | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ steps.generate.outputs.token }} | |
| - name: Format & rebuild | |
| run: | | |
| npm ci | |
| npm run format | |
| npm run build | |
| - name: Commit changes | |
| run: | | |
| git config --local user.name "github-actions[bot]" | |
| git config --local user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | |
| git add dist/ src/ | |
| git diff --staged --quiet || git commit -m "chore: rebuild dist" | |
| git push | |
| # Github Action bump PRs skip the TypeScript rebuild since they don't have the 'javascript' label | |
| # hence the 'always()' condition - to ensure this job runs for those PRs, too. | |
| auto-merge: | |
| name: π€ Approve and auto-merge | |
| needs: build | |
| if: always() && github.actor == 'dependabot[bot]' && !contains(needs.*.result, 'failure') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate token | |
| id: generate | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| app-id: ${{ vars.AUTOMATION_APP_ID }} | |
| private-key: ${{ secrets.AUTOMATION_APP_KEY }} | |
| - name: Approve and auto-merge | |
| env: | |
| GITHUB_TOKEN: ${{ steps.generate.outputs.token }} | |
| run: | | |
| gh pr review "${{ github.event.pull_request.html_url }}" --approve | |
| gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}" |