Skip to content

Commit 09b0389

Browse files
authored
Update action.yml
1 parent 825d417 commit 09b0389

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

action.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ runs:
66
- if: runner.os == 'Linux'
77
run: |
88
if test -d /__e && grep -q '^ID=alpine$' /etc/os-release; then
9-
cd "$(mktemp -d)"
10-
apk add --root "$(pwd)" --repositories-file /etc/apk/repositories --allow-untrusted --no-cache --no-scripts --initdb -- docker-cli
9+
TMPDIR=$(mktemp -d)
10+
apk add --root "$TMPDIR" --repositories-file /etc/apk/repositories --allow-untrusted --no-cache --no-scripts --initdb -- docker-cli
1111
12-
PATH="$(pwd)/usr/bin:$PATH" docker run --rm --user 0:0 --volume /:/hostfs --entrypoint /usr/sbin/chroot "$(docker inspect "$(hostname)" --format "{{ .Image }}")" /hostfs /bin/bash -xc \
12+
export PATH="$TMPDIR/usr/bin:$PATH"
13+
docker run --rm --user 0:0 --volume /:/hostfs --entrypoint /usr/sbin/chroot "$(docker inspect "$(hostname)" --format "{{ .Image }}")" /hostfs /bin/bash -xc \
1314
'find "$5" -type f -executable -name node -not -path "*_alpine/*" -print0 | sudo -u "$(stat -c "%U" "$5")" -- xargs -0 -n 1 -- /bin/bash -xc "$@"' -- \
1415
'docker run --rm --volume /:/hostfs --entrypoint /bin/sh "docker.io/library/node:$("$4" -e "console.log(process.versions.node)")-alpine" -xc "$@"' -- \
1516
'apk add --no-cache -- patchelf && cp "$(which node)" "/hostfs$2" && apk info --quiet --contents libgcc libstdc++ | xargs -- tar -cC / -T- | tar -xvC "$(dirname "$(dirname "/hostfs$2")")" --strip-components 1 && patchelf --set-rpath \$ORIGIN/../lib "/hostfs$2" && ldd "/hostfs$2"' -- \
1617
"$(docker inspect "$(hostname)" --format '{{ range.Mounts }}{{ if eq .Destination "/__e" }}{{ .Source }}{{ end }}{{ end }}')"
1718
18-
sed -i -e 's/^ID=alpine$/ID=linux/' /etc/os-release
19-
rm -rf -- "$(pwd)"
19+
sed -i -e 's/^ID=alpine$/ID=linux/' -- /etc/os-release
20+
rm -rf -- "$TMPDIR"
2021
fi
2122
shell: sh

0 commit comments

Comments
 (0)