diff --git a/.github/workflows/integ-test-dependency-submission.yml b/.github/workflows/integ-test-dependency-submission.yml index 430a67c6..41111c81 100644 --- a/.github/workflows/integ-test-dependency-submission.yml +++ b/.github/workflows/integ-test-dependency-submission.yml @@ -279,9 +279,8 @@ jobs: uses: ./dependency-submission with: dependency-graph: generate-and-submit + dependency-graph-report-dir: '${{ github.workspace }}/custom/report-dir' build-root-directory: .github/workflow-samples/groovy-dsl - env: - DEPENDENCY_GRAPH_REPORT_DIR: '${{ github.workspace }}/custom/report-dir' - name: Check generated dependency graphs shell: bash run: | @@ -310,9 +309,8 @@ jobs: uses: ./dependency-submission with: dependency-graph: generate-and-upload + dependency-graph-report-dir: '${{ github.workspace }}/custom/report-dir' build-root-directory: .github/workflow-samples/groovy-dsl - env: - DEPENDENCY_GRAPH_REPORT_DIR: '${{ github.workspace }}/custom/report-dir' custom-report-dir-download-and-submit: needs: custom-report-dir-upload @@ -327,10 +325,10 @@ jobs: uses: ./dependency-submission with: dependency-graph: download-and-submit + dependency-graph-report-dir: '${{ github.workspace }}/custom/report-dir' build-root-directory: .github/workflow-samples/groovy-dsl env: - DEPENDENCY_GRAPH_REPORT_DIR: '${{ github.workspace }}/custom/report-dir' - DEPENDENCY_GRAPH_DOWNLOAD_ARTIFACT_NAME: custom-report-dir-upload + DEPENDENCY_GRAPH_DOWNLOAD_ARTIFACT_NAME: custom-report-dir-upload # For testing, to avoid downloading artifacts from other worklfows - name: Check downloaded dependency graph shell: bash diff --git a/dependency-submission/action.yml b/dependency-submission/action.yml index e062cb3c..a9d07e8b 100644 --- a/dependency-submission/action.yml +++ b/dependency-submission/action.yml @@ -108,6 +108,13 @@ inputs: required: false default: 'generate-and-submit' + dependency-graph-report-dir: + description: | + Specifies where the dependency graph report will be generated. + Paths can relative or absolute. Relative paths are resolved relative to the workspace directory. + required: false + default: 'dependency-graph-reports' + dependency-graph-continue-on-failure: description: When 'false' a failure to generate or submit a dependency graph will fail the Step or Job. When 'true' a warning will be emitted but no failure will result. required: false diff --git a/docs/dependency-submission.md b/docs/dependency-submission.md index 844c12ec..f4e36416 100644 --- a/docs/dependency-submission.md +++ b/docs/dependency-submission.md @@ -102,6 +102,13 @@ In some cases, the default action configuration will not be sufficient, and addi # Do not attempt to submit the dependency-graph. Save it as a workflow artifact. dependency-graph: generate-and-upload + + # Specify the location where dependency graph files will be generated. + dependency-graph-report-dir: custom-report-dir + + # By default, failure to generate a dependency graph will cause the workflow to fail + dependency-graph-continue-on-failure: true + ``` See the [Action Metadata file](../dependency-submission/action.yml) for a more detailed description of each input parameter. diff --git a/setup-gradle/action.yml b/setup-gradle/action.yml index c6c4efbd..c4a30cf4 100644 --- a/setup-gradle/action.yml +++ b/setup-gradle/action.yml @@ -84,6 +84,13 @@ inputs: required: false default: 'disabled' + dependency-graph-report-dir: + description: | + Specifies where the dependency graph report will be generated. + Paths can relative or absolute. Relative paths are resolved relative to the workspace directory. + required: false + default: 'dependency-graph-reports' + dependency-graph-continue-on-failure: description: When 'false' a failure to generate or submit a dependency graph will fail the Step or Job. When 'true' a warning will be emitted but no failure will result. required: false diff --git a/sources/src/configuration.ts b/sources/src/configuration.ts index 28283462..a113cc80 100644 --- a/sources/src/configuration.ts +++ b/sources/src/configuration.ts @@ -43,7 +43,8 @@ export class DependencyGraphConfig { } getReportDirectory(): string { - return path.resolve(getWorkspaceDirectory(), 'dependency-graph-reports') + const param = core.getInput('dependency-graph-report-dir') + return path.resolve(getWorkspaceDirectory(), param) } getDownloadArtifactName(): string | undefined {