Skip to content

Conversation

ljones140
Copy link
Contributor

In order for GitHub to use action for Gradle Auto Submission we need to be able to set these values on the the JSON payload submitted to our snapshots API.

Added optional env var parameter:

GITHUB_DEPENDENCY_GRAPH_DETECTOR_NAME
GITHUB_DEPENDENCY_GRAPH_DETECTOR_VERSION
GITHUB_DEPENDENCY_GRAPH_DETECTOR_URL

These override the detector name, version and url if provided.

Testing

I ran ./plugin-self-test-local to test 1

Without DETECTOR env vars set maintains defaults:

{"detector":{"name":"GitHub Dependency Graph Gradle Plugin","url":"https://github.com/gradle/github-dependency-graph-gradle-plugin","version":"1.3.2"}

With new env vars set:

GITHUB_DEPENDENCY_GRAPH_DETECTOR_NAME=Lewis-super-detector
GITHUB_DEPENDENCY_GRAPH_DETECTOR_VERSION=1.1.1
GITHUB_DEPENDENCY_GRAPH_DETECTOR_URL=https://www.example.com

Snapshot detector is changed:

{"detector":{"name":"Lewis-super-detector","url":"https://www.example.com","version":"1.1.1"}

Footnotes

  1. I had to change the repo url in the script to go to my fork.

@ljones140 ljones140 changed the title GitHub Detector can be cuztomized with env vars GitHub Detector can be customized with env vars May 16, 2025
@bigdaz bigdaz merged commit 0b27887 into gradle:main May 16, 2025
15 checks passed
@bigdaz
Copy link
Member

bigdaz commented May 16, 2025

Thanks for the PR. Plugin v1.4.0 has been released and will be incorporated into gradle/actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants