Dependency updates in pull requests
To check dependency updates in pull requests (from Dependabot, Renovate or a person), for a Maven project, use the free Bumpwise action. The checkout needs the history, so that Bumpwise can read the build files of the target branch:
on: pull_request
jobs:
dependencies:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gilware/bumpwise-action@v1
with:
build: mvn -B -q compile
comment: true
The job fails when an update breaks your code, and the summary and a pull request comment list each place. With Gradle, use build: ./gradlew classes. To run the command line yourself, compile against the target branch's build files first: on an upgrade pull request the build files already name the new versions, and when an update breaks your code, that build fails before Bumpwise can check it. Then run bumpwise upgrade --changed-since origin/main --markdown; with --sarif and GitHub's upload-sarif action, code scanning shows each place on the pull request.
The pull request comment ends with one line saying the check comes from Bumpwise. Set BUMPWISE_NO_HINT=1 in the job to leave it out.
Check a library release
Run it after the build step, so a pull request that breaks the API without a major version fails. GitHub Actions, for a Gradle library (pinned to one version, with its checksum):
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- run: ./gradlew jar
- name: API compatibility
run: |
curl -fsSLO https://gilware.com/bumpwise/cli/bumpwise-1.1.6.jar
echo "a2a2313029ca82a8957e9eb9bcd173e8117aee41e4d8eaafb46c409c10e76dcd bumpwise-1.1.6.jar" | sha256sum -c
java -jar bumpwise-1.1.6.jar check --markdown >> "$GITHUB_STEP_SUMMARY"
The job fails on breaking changes the declared version does not allow, and the summary of the run shows the verdict, the next version and each change. Use --sarif instead to send the changes to GitHub code scanning, or --json to process them in a script. Any other CI works the same way; use --cache on a cached folder to avoid downloading the release again on every run.