mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-07 16:56:12 +02:00
Normalize paths to Gradle User Home when calculating cache keys
Fixes #77
This commit is contained in:
parent
cc5cdb7fe0
commit
5a5a5b4387
3 changed files with 21 additions and 6 deletions
|
@ -2,6 +2,7 @@ import * as core from '@actions/core'
|
|||
import * as cache from '@actions/cache'
|
||||
import * as github from '@actions/github'
|
||||
import * as crypto from 'crypto'
|
||||
import * as path from 'path'
|
||||
|
||||
export function isCacheDisabled(): boolean {
|
||||
return core.getBooleanInput('cache-disabled')
|
||||
|
@ -53,6 +54,12 @@ export function hashStrings(values: string[]): string {
|
|||
return hash.digest('hex')
|
||||
}
|
||||
|
||||
export function hashFileNames(fileNames: string[]): string {
|
||||
return hashStrings(
|
||||
fileNames.map(x => x.replace(new RegExp(`\\${path.sep}`, 'g'), '/'))
|
||||
)
|
||||
}
|
||||
|
||||
class CacheKey {
|
||||
key: string
|
||||
restoreKeys: string[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue