Skip to content
Open
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
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
description: Extra contents to write to user .bazelrc
required: false
default: ""
cache-optimized:
description: "Use timestamp-based cache keys with automatic old cache cleanup. Applies to disk and repository caches. Requires 'actions: write' permission on the GITHUB_TOKEN."
required: false
default: "false"
cache-save:
description: Whether to save caches. Set to false for pull requests to allow restores but prevent saves.
required: false
Expand Down
7 changes: 7 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as core from '@actions/core'
import * as github from '@actions/github'

const bazeliskVersion = core.getInput('bazelisk-version')
const cacheOptimized = core.getBooleanInput('cache-optimized')
const cacheSave = core.getBooleanInput('cache-save')
const cacheVersion = core.getInput('cache-version')
const moduleRoot = core.getInput('module-root')
Expand Down Expand Up @@ -136,6 +137,10 @@ if (externalCacheConfig) {
const token = core.getInput('token')
core.exportVariable('BAZELISK_GITHUB_TOKEN', token)

// Save token and optimized flag for post step
core.saveState('token', token)
core.saveState('cache-optimized', cacheOptimized.toString())

export default {
baseCacheKey,
cacheSave,
Expand All @@ -155,6 +160,7 @@ export default {
`${moduleRoot}/**/BUILD`
],
name: diskCacheName,
optimized: cacheOptimized,
paths: [bazelDisk]
},
externalCache,
Expand All @@ -171,6 +177,7 @@ export default {
enabled: repositoryCacheEnabled,
files: repositoryCacheFiles,
name: 'repository',
optimized: cacheOptimized,
paths: [bazelRepository]
},
}
Loading