Skip to content

Commit

Permalink
use combined ci-automerge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmoten committed Apr 14, 2022
1 parent fb987ab commit 7da8cd8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/automerge.yml

This file was deleted.

33 changes: 31 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
name: Java CI
name: ci

on: [push]
## Does continuous integration build with Java 8 and 11 and
## if succeeds and due to a dependabot pull request (minor or
## patch verson change) it will automatically merge the PR.

## Unlike many sample automerge workflows this does not rely
## on third-party libraries apart from the official dependabot
## repository ones. This reduces the security risk significantly
## (we don't want to unknowingly merge malicious code or expose
## secrets to a malicious third party).

on: [push, pull_request]

jobs:
build:
Expand All @@ -21,3 +31,22 @@ jobs:
with:
file: ./**/target/site/jacoco/jacoco.xml
name: codecov
dependabot:
runs-on: ubuntu-latest
needs: build
permissions:
pull-requests: write
contents: write
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.1.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{!contains(steps.metadata.outputs.dependency-names, 'maven-plugin-api') && (steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch')}}
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 7da8cd8

Please sign in to comment.