diff --git a/action.yml b/action.yml index c48f003..917f31d 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,6 @@ inputs: required: true runs: - using: "node12" + using: "node16" main: "dist/index.js" diff --git a/index.js b/index.js index 3f44aae..389a8c4 100644 --- a/index.js +++ b/index.js @@ -34,7 +34,9 @@ const duration = require('parse-duration'); abort("docker build args require --file") } - const primaryKey = sha256(`${cacheKey} ${dockerBuildArgs} ${sha256File(dockerfile)}`) + const firstTag = dockerBuildTags[0] + const hash = sha256(`${cacheKey} ${dockerBuildArgs} ${sha256File(dockerfile)}`) + const primaryKey = firstTag + hash const cachePath = path.join(runnerTemp, "cached-docker-build", primaryKey) let cacheHit = false