Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle GitHub Action Names with extra characters #72

Open
vorburger opened this issue Mar 4, 2025 · 1 comment
Open

Handle GitHub Action Names with extra characters #72

vorburger opened this issue Mar 4, 2025 · 1 comment

Comments

@vorburger
Copy link

E.g. this failed due to:

Run bazel-contrib/[email protected]
Configure Bazel
Setup Bazelisk
Restore cache for bazelisk
Restore cache for disk-Build, Test & Deploy (CI)
  
  /home/runner/work/_actions/bazel-contrib/setup-bazel/0.[14](https://github.com/enola-dev/enola/actions/runs/13642687157/job/38135724347#step:9:15).0/dist/node_modules/@actions/cache/lib/cache.js:71
          throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);
  ^
  ValidationError: Key Validation Error: setup-bazel-1-linux-disk-Build, Test & Deploy (CI)-5478129354fce37d2c7d5ab200e2f93e03c4aee6fabc88b08289fb8bf292d70d cannot contain commas.
      at checkKey (/home/runner/work/_actions/bazel-contrib/setup-bazel/0.14.0/dist/node_modules/@actions/cache/lib/cache.js:71:1)
      at /home/runner/work/_actions/bazel-contrib/setup-bazel/0.14.0/dist/node_modules/@actions/cache/lib/cache.js:203:1
      at Generator.next (<anonymous>)
      at /home/runner/work/_actions/bazel-contrib/setup-bazel/0.14.0/dist/node_modules/@actions/cache/lib/cache.js:31:1
      at new Promise (<anonymous>)
      at __webpack_modules__.5116.__awaiter (/home/runner/work/_actions/bazel-contrib/setup-bazel/0.14.0/dist/node_modules/@actions/cache/lib/cache.js:27:1)
      at restoreCacheV2 (/home/runner/work/_actions/bazel-contrib/setup-bazel/0.14.0/dist/node_modules/@actions/cache/lib/cache.js:192:1)
      at Object.<anonymous> (/home/runner/work/_actions/bazel-contrib/setup-bazel/0.14.0/dist/node_modules/@actions/cache/lib/cache.js:100:1)
      at Generator.next (<anonymous>)
      at /home/runner/work/_actions/bazel-contrib/setup-bazel/0.14.0/dist/node_modules/@actions/cache/lib/cache.js:31:1

I've realized that it's because of this change.

It's easily fixed (worked around), but in an ideal world, perhaps it would be more robust and handle GitHub Action names with extra characters?

@p0deje
Copy link
Member

p0deje commented Mar 4, 2025

I agree it would make sense to strip everything that is not alphanumeric, dashes, underscores. You could work it around by changing disk-cache input to a custom name.

If you're up to send PR, I'd be glad to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants