Download this file
| 1 | #!/bin/sh |
| 2 | set -eu |
| 3 | # Pi passes -c and the command as separate arguments. Never evaluate them here. |
| 4 | [ "$#" -eq 2 ] && [ "$1" = '-c' ] || exit 125 |
| 5 | command=$2 |
| 6 | /usr/bin/mkdir -p /tmp/pi-shell/go-build /tmp/pi-shell/go-tmp |
| 7 | set -- /opt/bwrap --die-with-parent --new-session \ |
| 8 | --unshare-user --unshare-pid --unshare-net --unshare-ipc --unshare-uts \ |
| 9 | --disable-userns --cap-drop ALL \ |
| 10 | --ro-bind /usr /usr --ro-bind /etc /etc \ |
| 11 | --symlink usr/bin /bin --symlink usr/lib /lib --symlink usr/lib64 /lib64 \ |
| 12 | --proc /proc --dev /dev --dir /home/runner \ |
| 13 | --bind /workspace /workspace --bind /tmp/pi-shell /tmp \ |
| 14 | --chdir /workspace --clearenv \ |
| 15 | --setenv HOME /home/runner --setenv TMPDIR /tmp --setenv LANG C.UTF-8 \ |
| 16 | --setenv PATH /opt/go/bin:/usr/bin:/bin \ |
| 17 | --setenv GIT_CONFIG_GLOBAL /dev/null --setenv GIT_CONFIG_NOSYSTEM 1 |
| 18 | if [ -d /opt/go ]; then |
| 19 | set -- "$@" --ro-bind /opt/go /opt/go --ro-bind-try /opt/go-mod /opt/go-mod \ |
| 20 | --setenv GOROOT /opt/go --setenv GOMODCACHE /opt/go-mod \ |
| 21 | --setenv GOCACHE /tmp/go-build --setenv GOTMPDIR /tmp/go-tmp \ |
| 22 | --setenv GOPROXY off --setenv GOSUMDB off --setenv GOTOOLCHAIN local \ |
| 23 | --setenv GOENV off --setenv GOWORK off --setenv GOFLAGS '' \ |
| 24 | --setenv GOTELEMETRY off --setenv CGO_ENABLED 0 |
| 25 | fi |
| 26 | exec /usr/bin/env -i "$@" -- /usr/bin/bash --noprofile --norc -c "$command" |
| 27 | |