Skip to content

Commit

Permalink
Get uid/gid from local container fs
Browse files Browse the repository at this point in the history
Get uid/gid from local container fs unless ACTION_UID/ACTION_GID
environment variables are explicitly provided

Signed-off-by: Kostis Papazafeiropoulos <[email protected]>
  • Loading branch information
papazof committed Jul 15, 2024
1 parent ef4e94a commit cae98dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ mc cp -r s3/$remote_path $local_path
ok_or_die "Could not fetch object"

# Fix owner of local path
chown -R "${ACTION_UID:-root}:${ACTION_GID:-root}" $local_path
LOCAL_UID="${ACTION_UID:-"$(stat -c %u .)"}"
LOCAL_GID="${ACTION_GID:-"$(stat -c %g .)"}"
info "Setting owner/group of $local_path to ${LOCAL_UID:-root}:${LOCAL_GID:-root}"
chown -R "${LOCAL_UID:-root}:${LOCAL_GID:-root}" "$local_path"

0 comments on commit cae98dd

Please sign in to comment.