Skip to content

Commit

Permalink
Fix github workflow for dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
ogesaku committed Jan 16, 2023
1 parent de13017 commit 930e1d8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,3 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: ./gradlew build jacocoTestReport coveralls --scan

dependabot:
needs: [ build ]
runs-on: ubuntu-latest
if: ${{ github.triggering_actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Auto-merge Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34 changes: 34 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dependabot

on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
needs: [build]
runs-on: ubuntu-latest
# if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/[email protected]
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve patch and minor updates
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr review $PR_URL --approve -b "Pull request **approved** because **it includes a patch or minor update**"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 930e1d8

Please sign in to comment.