Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions build-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ runs:
mkdir -p ".actions"
ln -sf "$host_actions_root/get-build-number" .actions/get-build-number
ln -sf "$host_actions_root/shared" .actions/shared
ln -sf "$host_actions_root/cache" .actions/cache
ls -la .actions/*
echo "::endgroup::"

Expand Down Expand Up @@ -136,20 +137,16 @@ runs:
if: ${{ inputs.disable-caching != 'true' }}
shell: bash
run: |
# Generate cache key from all Gradle files
find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \; | sort > gradle-md5-sums.txt
/usr/bin/find . \( -name '*.gradle' -o -name '*.gradle.kts' \) -type f -exec md5sum {} \; > gradle-md5-sums.txt
md5sum gradle/libs.versions.toml gradle/wrapper/gradle-wrapper.properties 2>/dev/null >> gradle-md5-sums.txt || true

GRADLE_CACHE_KEY=$(md5sum gradle-md5-sums.txt | awk '{ print $1 }')

echo "🔑 Generated cache key: ${GRADLE_CACHE_KEY}"
echo "GRADLE_CACHE_KEY=${GRADLE_CACHE_KEY}" >> "$GITHUB_ENV"

rm -f gradle-md5-sums.txt

- name: Restore Gradle Cache
if: ${{ inputs.disable-caching != 'true' }}
uses: SonarSource/gh-action_cache@v1
uses: ./.actions/cache
id: gradle-cache-restore
with:
path: ${{ inputs.cache-paths }}
Expand Down
2 changes: 1 addition & 1 deletion promote/promote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ MULTI_REPO_SRC_PRIVATE=sonarsource-private-qa
MULTI_REPO_SRC_PUBLIC=sonarsource-public-qa

set_build_env() {
DEFAULT_BRANCH=${DEFAULT_BRANCH:=$(gh repo view --json defaultBranchRef --jq ".defaultBranchRef.name")}
: "${DEFAULT_BRANCH:=$(gh repo view --json defaultBranchRef --jq ".defaultBranchRef.name")}"
export DEFAULT_BRANCH
}

Expand Down