action-docker-layer-caching icon indicating copy to clipboard operation
action-docker-layer-caching copied to clipboard

Can't use in a workflow with a comma in its name

Open tyilo opened this issue 5 years ago • 3 comments

Describe the bug You can't use this with a worflow containing a comma in its name.

Debug logs

Run satackey/[email protected]
  with:
    key: docker-layer-caching-Build, Test & Deploy-{hash}
    restore-keys: docker-layer-caching-Build, Test & Deploy-
    concurrency: 4
    skip-save: false
  env:
    DOCKER_IMAGE_NAME: ghcr.io/fredagscafeen/web
ValidationError: Key Validation Error: docker-layer-caching-Build, Test & Deploy-{hash} cannot contain commas.
    at checkKey (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:41761:15)
    at Object.<anonymous> (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:41784:13)
Error: ValidationError: Key Validation Error: docker-layer-caching-Build, Test & Deploy-{hash} cannot contain commas.
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:41718:71
    at new Promise (<anonymous>)
    at module.exports.692.__awaiter (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:41714:12)
    at Object.restoreCache (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:41774:12)
    at LayerCache.restoreRoot (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:33245:45)
    at LayerCache.restore (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:33227:45)
    at main (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/main.js/index.js:44116:42) {
  name: 'ValidationError'
}

Runner Environment (please complete the following information):

  • OS: ubuntu-latest
  • Action version: v0.0.8

tyilo avatar Oct 30 '20 13:10 tyilo

https://github.com/actions/cache has the same restriction, cache keys can't contain ,

rcowsill avatar Dec 02 '20 23:12 rcowsill

https://github.com/actions/cache has the same restriction, cache keys can't contain ,

Yeah, so this action shouldn't use the workflows name in the key for its cache.

tyilo avatar Dec 03 '20 00:12 tyilo

Ah, fair point. actions/cache doesn't set a default key, unlike this action.

Until this is resolved it can be worked around by setting key and restore-keys explicitly.

rcowsill avatar Dec 04 '20 15:12 rcowsill