gradlegithub-actionsbuild.gradlegradlew

How to enable Gradle Build Scan in GitHub Actions?


I'm new to Gradle. I have a GitHub Actions workflow that builds my Gradle project - build.yml.

The workflow uses gradle/actions/setup-gradle@v4 action under the hood. The action outputs build summary table with Build Scan® column:

enter image description here

I was wondering what the last column means, and it turned out there's a Build Scan feature if I add --scan flag to my build command.

However, when I add that flag, nothing happens. The build finishes successfully, and the build scan is still not published. Workflow run example.

The build command is ./gradlew build sonar --scan.

Could you please guide me how can I enable Build Scan in my project?


Solution

  • There is a warning logged that explains more:

    https://github.com/yvasyliev/telegram-forwarder-bot/actions/runs/15825391724/job/44604146726#step:3:174

    The build scan was not published due to a configuration problem.

    The Gradle Terms of Use have not been agreed to.

    For more information, please see https://gradle.com/help/gradle-plugin-terms-of-use.

    You need to configure your build to accept the terms: https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_scans_gradle_com