From add28b46904194a8dd8e700167c4967873c2f0d2 Mon Sep 17 00:00:00 2001 From: Michael Bastos Date: Tue, 12 Dec 2023 14:29:43 -0600 Subject: [PATCH] Fixing Dependabot auto merging --- .github/workflows/ci.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f16c3a..c6d07d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,8 @@ on: pull_request: permissions: - id-token: write pull-requests: write contents: write - repository-projects: write jobs: # Build job @@ -29,23 +27,19 @@ jobs: env: JEKYLL_ENV: production - dependabot-automation: - runs-on: ubuntu-latest + dependabot: + name: 'Dependabot' needs: [build] - if: ${{ github.actor == 'dependabot[bot]' }} - timeout-minutes: 13 + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} steps: - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@v1.6.0 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Approve & enable auto-merge for Dependabot PR - run: | - gh pr review --approve "$PR_URL" - gh pr edit "$PR_URL" -t "(auto merged) $PR_TITLE" - gh pr merge --auto --merge "$PR_URL" + github-token: '${{ secrets.GITHUB_TOKEN }}' + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" env: - PR_URL: ${{ github.event.pull_request.html_url }} - PR_TITLE: ${{ github.event.pull_request.title }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}