Skip to content

Commit 67cfd4a

Browse files
authored
Update action.yml
1 parent 27a704b commit 67cfd4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ runs:
55
steps:
66
- if: runner.os == 'Linux'
77
run: |
8-
if test -d /__e && grep -q '^ID=alpine$' /etc/os-release; then
8+
if test -n '${{ job.container.id }}' && grep -q '^ID=alpine$' /etc/os-release; then
99
ROOT=$(mktemp -d)
1010
apk add --root "$ROOT" --repositories-file /etc/apk/repositories --allow-untrusted --no-cache --no-scripts --initdb -- docker-cli
11-
"$ROOT/usr/bin/docker" run --rm --net host --user 0:0 --volume /:/hostfs --entrypoint /usr/sbin/chroot "$("$ROOT/usr/bin/docker" inspect "$(hostname)" --format "{{ .Image }}")" /hostfs /bin/bash -xc \
11+
"$ROOT/usr/bin/docker" run --rm --net host --user 0:0 --volume /:/hostfs --entrypoint /usr/sbin/chroot "$("$ROOT/usr/bin/docker" inspect '${{ job.container.id }}' --format "{{ .Image }}")" /hostfs /bin/bash -xc \
1212
'exec sudo -u "$(stat -c "%U" -- "$7")" -- /bin/bash -xc "$@"' -- \
1313
'find "$5" -type f -executable -name node -not -path "*_alpine/*" -print0 | exec xargs -0 -n 1 -- /bin/bash -xc "$@"' -- \
1414
'exec docker run --rm --volume /:/hostfs --entrypoint /bin/sh "docker.io/library/node:$("$4" -e "console.log(process.versions.node)")-alpine" -xc "$@"' -- \
1515
'apk add --no-cache -- patchelf && apk info --quiet --contents -- libgcc libstdc++ | xargs -- tar -cC / -T- | tar -xvC "$(dirname "/hostfs$2")/../lib" --strip-components 2 && cp "$(which node)" "/hostfs$2" && patchelf --set-rpath \$ORIGIN/../lib "/hostfs$2" && ldd "/hostfs$2"' -- \
16-
"$("$ROOT/usr/bin/docker" inspect "$(hostname)" --format '{{ range.Mounts }}{{ if eq .Destination "/__e" }}{{ .Source }}{{ end }}{{ end }}')"
16+
"$("$ROOT/usr/bin/docker" inspect '${{ job.container.id }}' --format '{{ range.Mounts }}{{ if eq .Destination "/__e" }}{{ .Source }}{{ end }}{{ end }}')"
1717
rm -rf -- "$ROOT"
1818
sed -i -e 's/^ID=alpine$/ID=linux/' /etc/os-release
1919
fi

0 commit comments

Comments
 (0)