Code Monkey home page Code Monkey logo

dependency-tree-diff-action's Introduction

Dependency Tree Diff - Github Action

.github/workflows/main.yml

Simple Github Action wrapper for Jake Wharton's Dependency Tree Diff tool.

Usage

The action only exposes output containing the diff, so to effectively consume its output it is highly recommended to use other Github Actions to customize your experience.

Create Pull Request comment on dependency change

See it in action!
Create .github/workflows/dependency_diff.yml

name: Generate dependency diff

on:
  pull_request:

jobs:
  generate-diff:
    runs-on: ubuntu-latest
    
    steps:
    - uses: actions/checkout@v3

    - uses: actions/setup-java@v3
      with:
        distribution: 'temurin'
        java-version: 21
        
    - uses: gradle/actions/setup-gradle@v3
      with:
        arguments: dependencies

    - id: dependency-diff
      name: Generate dependency diff
      uses: usefulness/dependency-tree-diff-action@v2

    - uses: peter-evans/find-comment@v3
      id: find_comment
      with:
        issue-number: ${{ github.event.pull_request.number }}
        body-includes: Dependency diff

    - uses: peter-evans/create-or-update-comment@v3
      if: ${{ steps.dependency-diff.outputs.text-diff != null || steps.find_comment.outputs.comment-id != null }}
      with:
        body: |
          Dependency diff (customize your message here): 
            ```diff
            ${{ steps.dependency-diff.outputs.text-diff }}
            ```
        edit-mode: replace
        comment-id: ${{ steps.find_comment.outputs.comment-id }}
        issue-number: ${{ github.event.pull_request.number }}
        token: ${{ secrets.GITHUB_TOKEN }}

Customization

All inputs with their default values:

    - id: dependency-diff
      uses: usefulness/dependency-tree-diff-action@v2
      with:
        configuration: 'releaseRuntimeClasspath'
        project: 'app'
        build-root-directory: .
        additional-gradle-arguments: ''
        lib-version: 'latest'
  • configuration - Selected Gradle configuration, passed to ./gradlew dependencies --configuration xxx. Should correspond to output artifact that is considered output of the project.
  • project - Gradle project which dependency tree diff should be generated for. Dependency diff for root projects can be configured using project: ''. For Android projects use the one that has com.android.application plugin applied.
  • build-root-directory - Relative path to folder containing gradle wrapper. Example usage: build-root-directory: library
  • additional-gradle-arguments - Additional arguments passed to internal Gradle invocation. Example: "--no-configuration-cache" or "--stacktrace"
  • lib-version - Overrides dependency-tree-diff dependency version. Example: "1.2.1", "1.1.0", "latest"

๐Ÿ™ Praise ๐Ÿ™ be ๐Ÿ™ to ๐Ÿ™ Wharton ๐Ÿ™

dependency-tree-diff-action's People

Contributors

dependabot[bot] avatar k-kagurazaka avatar mateuszkwiecinski avatar mergify[bot] avatar ntsk avatar penkzhou avatar renovate-bot avatar renovate[bot] avatar twisterrob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dependency-tree-diff-action's Issues

Allow ability to pass in --no-configuration-cache argument

I'm working out of a project that enables configuration cache by default for the entire project. However, the dependencies currently does not work well with configuration cache.

Please see:

Whenever I try using this GitHub action in my project, I get the following failure in CI:

* What went wrong:
Execution failed for task ':app:dependencies'.
> The value of this property has been discarded during serialization.

I guess we could wait until Gradle 7.6.0 gets officially released but in the meantime, it would be great if we could pass in additional optional arguments to the dependencies task so that I can pass in --no-configuration-cache until this issue gets resolved by Gradle.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/main.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
  • actions/upload-artifact v4
  • actions/upload-artifact v4
  • actions/upload-artifact v4
  • peter-evans/find-comment v3
  • peter-evans/create-or-update-comment v4
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
  • actions/upload-artifact v4
  • peter-evans/find-comment v3
  • peter-evans/create-or-update-comment v4
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
  • actions/upload-artifact v4
gradle
testproject/settings.gradle
  • com.gradle.develocity 3.17.5
testproject/build.gradle
  • com.starter.library.kotlin 0.75.0
  • androidx.paging:paging-common-ktx 3.3.0
gradle-wrapper
testproject/gradle/wrapper/gradle-wrapper.properties
  • gradle 8.8

  • Check this box to trigger a request for Renovate to run again on this repository

Doesn't work with gradle 8.x

When gradle 8.x is used then following error appears:
Cannot locate tasks that match '::dependencies'. The path should not include an empty segment (try ':dependencies' instead).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.