From 630b6066906b67208909c20c2c4c79efe47e5a0e Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Thu, 16 Mar 2023 21:32:13 +0100 Subject: [PATCH 1/2] Update action.yml to use Node 16 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 87416594fd9e2b3c9d16dbd9f3463dcd92d3916f Mon Sep 17 00:00:00 2001 From: Joan Miquel Date: Thu, 16 Mar 2023 22:14:14 +0100 Subject: [PATCH 2/2] Add first docker tag in primary key --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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