Fail nicely when dependency-submission is used after setup-gradle in the same Job (#37)

Previously, this would fail with a hard-to-diagnose error message.

Fixes #14
This commit is contained in:
Daz DeBoer
2024-02-08 23:16:54 -07:00
committed by GitHub
parent 2f23d645f2
commit b776693a71
2 changed files with 26 additions and 0 deletions

View File

@@ -50,6 +50,13 @@ inputs:
runs:
using: "composite"
steps:
- name: Check no setup-gradle
shell: bash
run: |
if [ -n "${GRADLE_BUILD_ACTION_SETUP_COMPLETED}" ]; then
echo "The dependency-submission action cannot be used in the same Job as the setup-gradle action. Please use a separate Job for dependency submission."
exit 1
fi
- name: Generate dependency graph
if: ${{ inputs.dependency-graph == 'generate-and-submit' || inputs.dependency-graph == 'generate-and-upload' }}
uses: gradle/actions/setup-gradle@v3.0.0