File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,15 +143,19 @@ jobs:
143143
144144 - name : Generate .SRCINFO
145145 run : |
146- # Use Arch Linux container to run makepkg
147- docker run --rm -v "$PWD/aur-rustnet-bin:/pkg" archlinux:latest bash -c '
148- pacman -Sy --noconfirm binutils fakeroot sudo &&
149- useradd -m builder &&
150- chown -R builder:builder /pkg &&
146+ # Use Arch Linux container to run makepkg as the host user
147+ docker run --rm -v "$PWD/aur-rustnet-bin:/pkg" --user $(id -u):$(id -g) archlinux:latest bash -c '
151148 cd /pkg &&
152- sudo -u builder makepkg --printsrcinfo > .SRCINFO &&
153- chown $(stat -c "%u:%g" PKGBUILD) .SRCINFO
154- '
149+ makepkg --printsrcinfo > .SRCINFO
150+ ' || {
151+ # If that fails (no write permissions), install tools as root then run as user
152+ docker run --rm -v "$PWD/aur-rustnet-bin:/pkg" archlinux:latest bash -c "
153+ pacman -Sy --noconfirm binutils fakeroot sudo &&
154+ useradd -m -u $(id -u) builder &&
155+ cd /pkg &&
156+ su builder -c 'makepkg --printsrcinfo > .SRCINFO'
157+ "
158+ }
155159
156160 echo ".SRCINFO generated successfully"
157161
You can’t perform that action at this time.
0 commit comments