Run AUR validation as non-root user in CI

This commit is contained in:
Sebastian Palencsar
2026-05-28 06:14:52 +02:00
parent 1a76d58461
commit 258e745170

View File

@@ -33,11 +33,18 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Create non-root build user
run: |
useradd -m builder
chown -R builder:builder "$GITHUB_WORKSPACE"
- name: Validate PKGBUILD and .SRCINFO - name: Validate PKGBUILD and .SRCINFO
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
cd "packaging/aur/${{ matrix.pkg }}" su builder -c "
set -euo pipefail
cd \"$GITHUB_WORKSPACE/packaging/aur/${{ matrix.pkg }}\"
makepkg --printsrcinfo > .SRCINFO.generated makepkg --printsrcinfo > .SRCINFO.generated
diff -u .SRCINFO .SRCINFO.generated diff -u .SRCINFO .SRCINFO.generated
@@ -45,3 +52,4 @@ jobs:
makepkg --verifysource --noconfirm makepkg --verifysource --noconfirm
namcap PKGBUILD .SRCINFO namcap PKGBUILD .SRCINFO
"