-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide input parameters for key environment variable supported by GitHub Dependency Graph plugin #193
Comments
For the We first tried the naive approach: steps:
- uses: gradle/actions/setup-gradle@v3
env:
DEPENDENCY_GRAPH_REPORT_DIR: ${{ runner.temp }}/setup-gradle
- run: ./gradlew build But it failed with a strange Groovy error:
After a little of debugging, it turned out that the function maybeExportVariable(variableName: string, value: unknown): void {
if (!process.env[variableName]) {
core.exportVariable(variableName, value)
}
} To make it working, we need to globally export the variable. Currently, we do it this way: steps:
- run: echo "DEPENDENCY_GRAPH_REPORT_DIR=${{ runner.temp }}/setup-gradle" >> $GITHUB_ENV
shell: bash
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew build As I said, it's inconvenient for us. We would love to have the |
I would prefer to restrict these input parameters to the Here are some options you have right now:
|
Ah, I now see that with the fixed support for a custom report directory, the env var needs to be visible to both the We could change this function to always export the variable, using the existing value if it is set and using the default value if not. A PR to fix this would be welcome. |
In our case, it's a company-wide migration to use the So basically, we say to our developers: "use our
We can't do that, because we use the I can provide a PR which changes Please let me know what you think 🙂 |
As I stated, I'd prefer not to add more dependency-submission specific input parameters to I think a PR to change |
Currently, there are some key configuration inputs to the GitHub Dependency Graph plugin that can only be provided via environment variables.
The full list is here, here and here.
We don't need to support all of these variables, since some are set by the action and there's little or no reason to override them. We also only need to support these for
dependency-submission
. Whensetup-gradle
withdependency-graph
enabled, users can continue to provide environment variables.For now, we should at least provide:
report-dir
:DEPENDENCY_GRAPH_REPORT_DIR
with paths resolved relative to the project workspaceexclude-projects
:DEPENDENCY_GRAPH_EXCLUDE_PROJECTS
exclude-configurations
:DEPENDENCY_GRAPH_EXCLUDE_CONFIGURATIONS
For now we can leave out the variables that control the 'runtime' scope, since these are largely experimental. Ideally, the plugin would make a good guess at the dependencies that are in runtime scope, but it's not trivial.
The text was updated successfully, but these errors were encountered: