Skip to content

Commit e907022

Browse files
committed
Add expanduser to the path passed to stash restore action
Often when you want to upload cache, you are doing it from the ~/.cache or similar directory. And you want to pass "~" rather than path to the home directory. The original upload-artifact and download-artifact are expanding the `~` to home dir, and since "stash/save" uses direction "upload-artifact" it also accepts the `~` prefix. However the "stash/restore" action uses gh download and passes the path via environment variable, so bash will not expand it. We need to manually expand user in the mung step
1 parent 4ab8682 commit e907022

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stash/restore/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ runs:
7878
m.output_munged_name(output = 'stash_head')
7979
m.output_munged_name(ref = 'base_ref', output = 'stash_base')
8080
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
81-
f.write(f'stash_path={os.path.abspath(os.environ["stash_path"])}' + '\n')
81+
f.write(f'stash_path={os.path.abspath(os.path.expanduser(os.environ["stash_path"]))}' + '\n')
8282
8383
- name: Check for stash artifact
8484
id: check-stash

0 commit comments

Comments
 (0)