Skip to content

Commit d75d07d

Browse files
authored
feat: add cache-hit output (#354)
1 parent 9f44723 commit d75d07d

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ inputs:
3131
outputs:
3232
tflint-version:
3333
description: The installed version of TFLint
34+
cache-hit:
35+
description: A boolean value to indicate a cache entry was found
3436
stdout:
3537
description: The output (stdout) produced by the tflint command. Only available if `tflint_wrapper` is set to `true`.
3638
stderr:

dist/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88934,6 +88934,8 @@ async function restoreCache() {
8893488934
const restoreKeys = [keyPrefix];
8893588935
const matchedKey = await cache.restoreCache([pluginDir], primaryKey, restoreKeys);
8893688936

88937+
core.setOutput('cache-hit', Boolean(matchedKey));
88938+
8893788939
if (!matchedKey) {
8893888940
core.info('TFLint plugin cache not found');
8893988941
return;

dist/post/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84066,6 +84066,8 @@ async function restoreCache() {
8406684066
const restoreKeys = [keyPrefix];
8406784067
const matchedKey = await cache.restoreCache([pluginDir], primaryKey, restoreKeys);
8406884068

84069+
core.setOutput('cache-hit', Boolean(matchedKey));
84070+
8406984071
if (!matchedKey) {
8407084072
core.info('TFLint plugin cache not found');
8407184073
return;

src/cache-restore.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ async function restoreCache() {
5050
const restoreKeys = [keyPrefix];
5151
const matchedKey = await cache.restoreCache([pluginDir], primaryKey, restoreKeys);
5252

53+
core.setOutput('cache-hit', Boolean(matchedKey));
54+
5355
if (!matchedKey) {
5456
core.info('TFLint plugin cache not found');
5557
return;

0 commit comments

Comments
 (0)