cache icon indicating copy to clipboard operation
cache copied to clipboard

`Relative pathing '.' ... is not allowed` discriminates against local actions

Open jsoref opened this issue 2 years ago • 4 comments

#684 asked about relative paths, and was rejected because there were other things someone could do...

I'm developing an action and I'd like to cache content within my action. Most of the time, my action will be run from something like: /home/runner/work/check-spelling/check-spelling/, but when it's testing itself, the github.action_path property has a trailing ./. Afaict, GHA does not have string processing functions that would make stripping a trailing ./ or / easy to do.

The result is: https://github.com/jsoref/check-spelling/actions/runs/3993931770/jobs/6851091696

Run actions/cache@v3
  with:
    path: /home/runner/work/check-spelling/check-spelling/.//dictionaries
    key: check-spelling-dictionaries-
    enableCrossOsArchive: false
  env:
    workflow_check_commit_messages: commits
    PATH: /home/runner/work/check-spelling/check-spelling/.//wrappers:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    replace_v3_actions_checkout: 1
Cache not found for input keys: check-spelling-dictionaries-

followed by

Post job cleanup.
Post job cleanup.
Warning: Invalid pattern '/home/runner/work/check-spelling/check-spelling/.//dictionaries'. Relative pathing '.' and '..' is not allowed.

Rejecting '..' is perfectly reasonable. Rejecting /./ seems questionable, especially given that GHA naturally constructs paths of this form.

If GHA were to not construct paths of this form (which would make me otherwise happy), I'd be happy to close this Issue...


p.s. it would be nicer if the complaint about "relative pathing" was triggered in the normal uses stage instead of in the post stage.

jsoref avatar Jan 24 '23 07:01 jsoref

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

github-actions[bot] avatar Sep 04 '23 08:09 github-actions[bot]

☹️

jsoref avatar Sep 04 '23 13:09 jsoref

This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.

github-actions[bot] avatar Mar 24 '24 08:03 github-actions[bot]

😞🤕

jsoref avatar Mar 24 '24 12:03 jsoref