mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-05 07:46:11 +02:00
Allow use of caches 'read-only'
To avoid evicting useful entries, some pipeline may benefit from using existing cache entries without writing any changes back to the cache. Fixes #62
This commit is contained in:
parent
543cacb256
commit
a693ccda4b
4 changed files with 31 additions and 0 deletions
|
@ -1,12 +1,20 @@
|
|||
import * as core from '@actions/core'
|
||||
|
||||
import * as cacheWrapper from './cache-wrapper'
|
||||
import * as cacheDependencies from './cache-dependencies'
|
||||
import * as cacheConfiguration from './cache-configuration'
|
||||
|
||||
// Invoked by GitHub Actions
|
||||
export async function run(): Promise<void> {
|
||||
if (isCacheReadOnly()) return
|
||||
|
||||
await cacheWrapper.cacheWrapperDist()
|
||||
await cacheDependencies.cacheDependencies()
|
||||
await cacheConfiguration.cacheConfiguration()
|
||||
}
|
||||
|
||||
function isCacheReadOnly(): boolean {
|
||||
return core.getBooleanInput('cache-read-only')
|
||||
}
|
||||
|
||||
run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue