Skip to content

Commit

Permalink
fix(dependabot): Fix Github Action to automerge Dependabot updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vinsonchuong committed Oct 27, 2020
1 parent ec3621f commit 4739c6f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ jobs:
dependabot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
- if: ${{ github.actor == 'dependabot[bot]' }}
uses: actions/github-script@v3
with:
target: minor
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.pullRequests.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
})
github.pullRequests.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number
})
18 changes: 14 additions & 4 deletions src/templates/dependabot.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ export default function () {
dependabot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-dependabot-auto-merge@v2
- if: \${{ github.actor == 'dependabot[bot]' }}
uses: actions/github-script@v3
with:
target: minor
github-token: \${{ secrets.GITHUB_TOKEN }}
script: |
github.pullRequests.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
})
github.pullRequests.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number
})
`
}
}

0 comments on commit 4739c6f

Please sign in to comment.