Skip to content

Commit

Permalink
feat: generate lockfiles for Gradle subprojects
Browse files Browse the repository at this point in the history
  • Loading branch information
stempler committed Dec 8, 2023
1 parent 37c8f83 commit b841f71
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/gradle-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ jobs:
JAVA_TOOL_OPTIONS: ${{ inputs.java-options }}
run: ./gradlew dependencies --write-locks

- name: Write dependency lockfile for security scan (submodules)
if: ${{ inputs.multi-module }}
env:
ORG_GRADLE_PROJECT_wetfArtifactoryUser: ${{ secrets.WETF_ARTIFACTORY_USER }}
ORG_GRADLE_PROJECT_wetfArtifactoryPassword: ${{ secrets.WETF_ARTIFACTORY_PASSWORD }}
JAVA_TOOL_OPTIONS: ${{ inputs.java-options }}
shell: bash
run: |
# Find all subfolders containing build.gradle or build.gradle.kts files
folders=$(find . -type f \( -name "build.gradle" -o -name "build.gradle.kts" \) -exec dirname {} \; | grep -oP '(?<=^\./).*' | sort -u)
# Loop over the identified subfolders
for folder in $folders; do
echo "Processing subproject: $folder"
./gradlew ":${folder}:dependencies" --write-locks
done
- name: Run custom command
if: ${{ inputs.pre-build-command != '' }}
run: ${{ inputs.pre-build-command }}
Expand Down

0 comments on commit b841f71

Please sign in to comment.