build.yml

 1name: build
 2on: [push, pull_request]
 3
 4jobs:
 5  build:
 6    uses: charmbracelet/meta/.github/workflows/build.yml@main
 7    with:
 8      go-version: ""
 9      go-version-file: ./go.mod
10    secrets:
11      gh_pat: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
12
13  dependabot:
14    needs: [build]
15    runs-on: ubuntu-latest
16    permissions:
17      pull-requests: write
18      contents: write
19    if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
20    steps:
21      - id: metadata
22        uses: dependabot/fetch-metadata@v2
23        with:
24          github-token: "${{ secrets.GITHUB_TOKEN }}"
25      - run: |
26          echo "Approving..."
27          gh pr review --approve "$PR_URL"
28          echo "Merging..."
29          gh pr merge --squash --auto "$PR_URL"
30        env:
31          PR_URL: ${{github.event.pull_request.html_url}}
32          GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}