File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 8080 mkdir -p ".actions"
8181 ln -sf "$host_actions_root/get-build-number" .actions/get-build-number
8282 ln -sf "$host_actions_root/shared" .actions/shared
83+ ln -sf "$host_actions_root/cache" .actions/cache
8384 ls -la .actions/*
8485 echo "::endgroup::"
8586
@@ -130,20 +131,16 @@ runs:
130131 if : ${{ inputs.disable-caching != 'true' }}
131132 shell : bash
132133 run : |
133- # Generate cache key from all Gradle files
134- find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \; | sort > gradle-md5-sums.txt
135- md5sum gradle/libs.versions.toml gradle/wrapper/gradle-wrapper.properties 2>/dev/null >> gradle-md5-sums.txt || true
136-
137- GRADLE_CACHE_KEY=$(md5sum gradle-md5-sums.txt | awk '{ print $1 }')
138-
134+ gradle-md5-sums="$(mktemp)"
135+ /usr/bin/find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \; > "$gradle-md5-sums"
136+ md5sum gradle/libs.versions.toml gradle/wrapper/gradle-wrapper.properties 2>/dev/null >> "$gradle-md5-sums" || true
137+ GRADLE_CACHE_KEY=$(md5sum "$gradle-md5-sums" | awk '{ print $1 }')
139138 echo "🔑 Generated cache key: ${GRADLE_CACHE_KEY}"
140139 echo "GRADLE_CACHE_KEY=${GRADLE_CACHE_KEY}" >> "$GITHUB_ENV"
141140
142- rm -f gradle-md5-sums.txt
143-
144141 - name : Restore Gradle Cache
145142 if : ${{ inputs.disable-caching != 'true' }}
146- uses : SonarSource/gh-action_cache@v1
143+ uses : ./.actions/cache
147144 id : gradle-cache-restore
148145 with :
149146 path : ${{ inputs.cache-paths }}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ MULTI_REPO_SRC_PRIVATE=sonarsource-private-qa
4444MULTI_REPO_SRC_PUBLIC=sonarsource-public-qa
4545
4646set_build_env () {
47- DEFAULT_BRANCH= ${DEFAULT_BRANCH:= $(gh repo view --json defaultBranchRef --jq " .defaultBranchRef.name" )}
47+ : " ${DEFAULT_BRANCH:= $(gh repo view --json defaultBranchRef --jq " .defaultBranchRef.name" )} "
4848 export DEFAULT_BRANCH
4949}
5050
You can’t perform that action at this time.
0 commit comments