fix(ci): reclaim aur-repo ownership after docker chown

The 'Push to AUR' step failed on run 24195384571 with:
  error: could not lock config file .git/config: Permission denied

Inside the docker block we 'chown -R builduser:builduser /pkg', which
propagates through the bind mount and transfers ownership of aur-repo/
(including .git/) to the container's builduser UID. When control returns
to the runner user, 'git config user.name' can no longer write .git/config
and the step exits 255.

Chown the directory back to the runner's UID/GID before resuming host-side
git operations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Razvan Dimescu
2026-04-09 18:20:18 +03:00
parent 819614fa7d
commit 251348a256

View File

@@ -135,6 +135,12 @@ jobs:
sudo -u builduser makepkg -od && sudo -u builduser makepkg --printsrcinfo > .SRCINFO sudo -u builduser makepkg -od && sudo -u builduser makepkg --printsrcinfo > .SRCINFO
" "
# Reclaim ownership: the in-container 'chown -R builduser:builduser /pkg'
# propagates through the bind mount, leaving .git/ owned by the container's
# builduser UID. Without this, subsequent 'git config' on the host fails with
# "could not lock config file .git/config: Permission denied".
sudo chown -R "$(id -u):$(id -g)" .
# Set the commit identity using secrets for security and auditability. # Set the commit identity using secrets for security and auditability.
git config user.name "$AUR_USER" git config user.name "$AUR_USER"
git config user.email "$AUR_EMAIL" git config user.email "$AUR_EMAIL"