Skip to content

be-hase/gradle-dependency-diff-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gradle-dependency-diff-action

GitHub Super-Linter CI Check dist/ CodeQL Coverage

What's this action?

  • Executes dependency-tree-diff for PRs and reports dependency differences.
  • The dependency differences are reported as GitHub Checks.
    • Since GitHub Checks have a character limit of 65,535, multiple GitHub Checks will be created if there are many differences.
    • If the limit is exceeded for a single project, the output will be truncated. In such cases, the full differences can be viewed by downloading the actions artifact.
  • When there are dependency differences, the following feedback is provided (can be disabled via settings):
    • Posts the GitHub Checks URL as a PR comment.
    • Adds a PR label.
    • Uploads the dependency differences as a text file to the actions artifact.
  • Supports Gradle multi-project setups.

Getting Start

Apply project-report plugin

Please apply the project-report plugin to the project where you want to obtain the dependency differences.

plugins {
    //...
    `project-report` // HERE !
}

Write a workflow

Start by writing a workflow like the one below. It’s very easy to get started.

name: CI
on:
  pull_request:

jobs:
  dependencies-diff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 17
      - uses: be-hase/gradle-dependency-diff-action@v1

Report Samples

The appearance of the PR:

screenshot1

The appearance of the Checks:

screenshot2

The HTML report generated in the actions artifact:

screenshot3

Configuration

Name Description Default Value
tool-version Version of dependency-tree-diff 1.2.1
configurations Target dependency configurations. Multiple values can be specified, separated by commas. runtimeClasspath
post-pr-comment If true, posts a PR comment when there are dependency differences. true
update-pr-body If true, updates the PR body when there are dependency differences. false
assign-label If true, adds a PR label when there are dependency differences. true
label-name Label name used with assign-label. dependencies-change
upload-artifact If true, uploads the dependency differences as a text file to the actions artifact. true
token Token used by this action. ${{ github.token }}

FAQ

The error `Task 'dependencyReport' not found in root project 'xxx' and its subprojects` has occurred.

The project-report plugin may not be applied to the base branch of the Pull Request.

Contribute

# Install the dependencies
npm install

# Run the tests
npm test

# Package the TypeScript for distribution
npm run bundle

# ...etc. See package.json

This template is used as a reference.