Skip to content

Commit a79f7a8

Browse files
authored
gh-actions/bind-mounts: Cleanups/fixes (#2905)
Signed-off-by: Ryan Northey <ryan@synca.io>
1 parent a8e7294 commit a79f7a8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

gh-actions/bind-mounts/action.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ inputs:
99
# - src: /mnt/foo
1010
# target: /some/other/path/foo
1111
# rm: false
12-
# permissions:
12+
# chown:
1313
# command-pre:
1414
# command-post:
1515
# - src: /mnt/bar
1616
# target: /some/other/path/bar
1717
# rm: true
18-
# permissions: runner:runner
18+
# chown: runner:runner
1919
# command-pre: sudo systemctl stop bar
2020
# command-post: sudo systemctl start bar
2121

@@ -30,10 +30,13 @@ runs:
3030
input-format: yaml
3131
filter: |
3232
.[]
33+
| (.target
34+
| gsub("RUNNER_TEMP"; "${{ runner.temp }}")
35+
| gsub("GITHUB_WORKSPACE"; "${{ github.workspace }}")) as $target
3336
| (if ."command-pre" then ."command-pre" + "\n" else "" end),
3437
"sudo mkdir -p \(.src)",
35-
(if .permissions then "sudo chown \(.permissions) \(.src)" else "" end),
36-
(if .rm then "sudo rm -rf \(.target)" else "" end),
37-
"sudo mkdir -p \(.target)",
38-
"sudo mount -o bind \(.src) \(.target)",
38+
(if .chown then "sudo chown \(.chown) \(.src)" else "" end),
39+
(if .rm then "sudo rm -rf \($target)" else "" end),
40+
"sudo mkdir -p \($target)",
41+
"sudo mount -o bind \(.src) \($target)",
3942
(if ."command-post" then ."command-post" + "\n" else "" end)

0 commit comments

Comments
 (0)