build: allow to execute command from container from entrypoint

This commit is contained in:
Evgenii Alekseev 2024-11-29 16:17:45 +02:00
parent c4a56f1454
commit 7c7804a9f4
3 changed files with 5 additions and 2 deletions

View File

@ -15,9 +15,9 @@ jobs:
container:
image: archlinux:base
options: --privileged -w /build
volumes:
- ${{ github.workspace }}:/build
options: --privileged -w /build
steps:
- uses: actions/checkout@v3

View File

@ -17,9 +17,9 @@ jobs:
container:
image: archlinux:base
options: -w /build
volumes:
- ${{ github.workspace }}:/build
options: -w /build
steps:
- uses: actions/checkout@v3

View File

@ -57,6 +57,9 @@ ahriman "${AHRIMAN_DEFAULT_ARGS[@]}" service-setup "${AHRIMAN_SETUP_ARGS[@]}"
# create machine-id which is required by build tools
systemd-machine-id-setup &> /dev/null
# special workaround to emulate /bin/bash entrypoint if first argument starts with /
[[ "$1" =~ ^/.* ]] && exec "$@"
# if AHRIMAN_FORCE_ROOT is set or command is unsafe we can run without sudo
# otherwise we prepend executable by sudo command
if [ -n "$AHRIMAN_FORCE_ROOT" ]; then