From 24841c11e3ae2d5cf8aee77307a5b4e5c312b3d7 Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Thu, 30 Jan 2025 11:29:53 -0600 Subject: [PATCH 1/3] ci: add GitHub Actions workflow for Dependabot auto-approval --- .github/workflows/dep-autoapprove.yml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/dep-autoapprove.yml diff --git a/.github/workflows/dep-autoapprove.yml b/.github/workflows/dep-autoapprove.yml new file mode 100644 index 0000000000..0f9708f2ae --- /dev/null +++ b/.github/workflows/dep-autoapprove.yml @@ -0,0 +1,33 @@ +name: Dependabot auto-approve +on: pull_request + +permissions: + pull-requests: write + +jobs: + dependabot-approve: + runs-on: ubuntu-latest + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'target/goalert' + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + steps: + - uses: actions/setup-go@v5 + with: + go-version: '1.23' + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'yarn' + - name: Run make generate + run: make generate + - uses: stefanzweifel/git-auto-commit-action@v5 + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 35903cc3c82fcdf4c81766464d61c27bfc0974fd Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Thu, 30 Jan 2025 11:31:33 -0600 Subject: [PATCH 2/3] ci: update commit message for auto-commit action in Dependabot workflow --- .github/workflows/dep-autoapprove.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dep-autoapprove.yml b/.github/workflows/dep-autoapprove.yml index 0f9708f2ae..5e9bc760f9 100644 --- a/.github/workflows/dep-autoapprove.yml +++ b/.github/workflows/dep-autoapprove.yml @@ -26,6 +26,8 @@ jobs: - name: Run make generate run: make generate - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Apply make generate changes - name: Approve a PR run: gh pr review --approve "$PR_URL" env: From 3fd1d310edeb47bc353c11e6bf9530509d71384b Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Thu, 30 Jan 2025 11:50:34 -0600 Subject: [PATCH 3/3] Update .github/workflows/dep-autoapprove.yml Co-authored-by: Alaric Whitney --- .github/workflows/dep-autoapprove.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dep-autoapprove.yml b/.github/workflows/dep-autoapprove.yml index 5e9bc760f9..bdb31ea1d9 100644 --- a/.github/workflows/dep-autoapprove.yml +++ b/.github/workflows/dep-autoapprove.yml @@ -1,3 +1,4 @@ +--- name: Dependabot auto-approve on: pull_request