Skip to content

Commit

Permalink
Fixing Dependabot auto merging
Browse files Browse the repository at this point in the history
  • Loading branch information
bastosmichael authored Dec 12, 2023
1 parent 8831b6a commit add28b4
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ on:
pull_request:

permissions:
id-token: write
pull-requests: write
contents: write
repository-projects: write

jobs:
# Build job
Expand All @@ -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/[email protected]
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}}

0 comments on commit add28b4

Please sign in to comment.