diff --git a/action.yml b/action.yml index e3dbbbfd..1a822ea9 100644 --- a/action.yml +++ b/action.yml @@ -11,13 +11,17 @@ inputs: required: true default: docker-layer-caching-${{ github.workflow }}-{hash} restore-keys: - description: An ordered list of keys to use for restoring the cache if no cache hit occurred for key + description: An ordered list of keys to use for restoring the cache if no cache hit occurred for key required: false default: docker-layer-caching-${{ github.workflow }}- concurrency: description: The number of concurrency when restoring and saving layers required: true default: '4' + skip-save: + description: Skip saving layers in the post step + required: false + default: 'false' runs: using: node12 diff --git a/post.ts b/post.ts index 09593358..529e8f2d 100644 --- a/post.ts +++ b/post.ts @@ -4,7 +4,13 @@ import exec from 'actions-exec-listener' import { LayerCache } from './src/LayerCache' import { ImageDetector } from './src/ImageDetector' import { assertType } from 'typescript-is' + const main = async () => { + if (JSON.parse(core.getInput('skip-save', { required: true }))) { + core.info('Skipping save.') + return + } + const primaryKey = core.getInput('key', { required: true }) const restoredKey = JSON.parse(core.getState(`restored-key`)) as string