2019-11-30 19:27:08 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-11-20 06:59:39 +00:00
|
|
|
# Get host user/group info so we create files with the correct ownership
|
2023-11-20 07:08:06 +00:00
|
|
|
USERNAME=$(stat -c '%U' "$GITHUB_WORKSPACE/$PROJECT_PATH")
|
|
|
|
USERID=$(stat -c '%u' "$GITHUB_WORKSPACE/$PROJECT_PATH")
|
|
|
|
GROUPNAME=$(stat -c '%G' "$GITHUB_WORKSPACE/$PROJECT_PATH")
|
|
|
|
GROUPID=$(stat -c '%g' "$GITHUB_WORKSPACE/$PROJECT_PATH")
|
2019-11-30 19:27:08 +00:00
|
|
|
|
2023-11-20 07:14:05 +00:00
|
|
|
groupadd -g $GROUPID $GROUPNAME
|
2023-11-20 06:59:39 +00:00
|
|
|
useradd -u $USERID -g $GROUPID $USERNAME
|
|
|
|
usermod -aG $GROUPNAME $USERNAME
|
|
|
|
mkdir -p "/home/$USERNAME"
|
|
|
|
chown $USERNAME:$GROUPNAME "/home/$USERNAME"
|
|
|
|
|
2023-11-20 09:03:25 +00:00
|
|
|
chmod 777 /dev/stdout
|
|
|
|
chmod 777 /dev/stderr
|
|
|
|
|
2023-11-20 06:59:39 +00:00
|
|
|
# Switch to the host user so we can create files with the correct ownership
|
2023-11-20 07:56:24 +00:00
|
|
|
su $USERNAME -c "$SHELL -c 'source /steps/runsteps.sh'"
|
2023-11-20 06:59:39 +00:00
|
|
|
|
2023-11-20 07:38:26 +00:00
|
|
|
exit $?
|