Skip to content

Commit

Permalink
Merge pull request #265 from depot/gactions-cache
Browse files Browse the repository at this point in the history
Fix the resolution of GitHub Actions cache endpoint
  • Loading branch information
jacobwgillespie authored Apr 8, 2024
2 parents 800d55f + d433cc7 commit 45e7b2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/depot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func main() {
if os.Getenv("DEPOT_DISABLE_OTEL") != "" {
helpers.DisableOTEL()
}
helpers.FixGitHubActionsCacheEnv()

cpuProfile := os.Getenv("DEPOT_CPU_PROFILE")
var cpuProfileFile *os.File
Expand Down
12 changes: 12 additions & 0 deletions pkg/helpers/gha.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package helpers

import "os"

// If the CLI is running inside a Depot GitHub Actions runner, restore the original
// GitHub Actions cache URL so that the remote BuildKit doesn't attempt to use the internal cache.
func FixGitHubActionsCacheEnv() {
original := os.Getenv("GACTIONSCACHE_URL")
if original != "" {
os.Setenv("ACTIONS_CACHE_URL", original)
}
}

0 comments on commit 45e7b2e

Please sign in to comment.