mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
* fix user on rust and brew scripts * set user on a factory stage * get last user from /etc/passwd Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
15 lines
407 B
Bash
15 lines
407 B
Bash
#!/bin/bash
|
|
|
|
# Fix permissions for Homebrew
|
|
# https://github.com/actions/virtual-environments/issues/1568
|
|
|
|
brew_folder="/home/linuxbrew/"
|
|
homebrew_user=$(cut -d: -f1 /etc/passwd | tail -1)
|
|
|
|
if [ -d "$brew_folder" ]; then
|
|
brew_folder_owner=$(ls -ld $brew_folder | awk '{print $3}')
|
|
if [ "$homebrew_user" != "$brew_folder_owner" ]; then
|
|
chown "$homebrew_user":docker -R $brew_folder
|
|
fi
|
|
fi
|