Skip to content

Commit 6d522eb

Browse files
authored
Disable gradle build cache on releases to mitigate supply chain risk (#8254)
1 parent 207c861 commit 6d522eb

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/build-daily.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ jobs:
3434
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
3535
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
3636
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
37-
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
37+
# disable gradle build cache, ensuring we're building from source to mitigate supply chain risk
38+
DISABLE_REMOTE_BUILD_CACHE: true
3839

3940
workflow-notification:
4041
permissions:

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
3838
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
3939
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
40-
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
40+
# disable gradle build cache, ensuring we're building from source to mitigate supply chain risk
41+
DISABLE_REMOTE_BUILD_CACHE: true
4142

4243
- name: Set environment variables
4344
run: |

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ include(":animal-sniffer-signature")
7575
val develocityServer = "https://develocity.opentelemetry.io"
7676
val isCI = System.getenv("CI") != null
7777
val develocityAccessKey = System.getenv("DEVELOCITY_ACCESS_KEY") ?: ""
78+
val disableRemoteBuildCache = System.getenv("DISABLE_REMOTE_BUILD_CACHE") != null
7879

7980
develocity {
8081
if (develocityAccessKey.isNotEmpty()) {
@@ -110,6 +111,7 @@ develocity {
110111
buildCache {
111112
remote(HttpBuildCache::class) {
112113
url = uri("$develocityServer/cache/")
114+
isEnabled = !disableRemoteBuildCache
113115
isPush = isCI && develocityAccessKey.isNotEmpty()
114116
}
115117
}

0 commit comments

Comments
 (0)