Skip to content

Commit

Permalink
💚 Change approach and use runuser -unobody
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorBeeston committed Jul 29, 2024
1 parent ce8a228 commit fdba1a5
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/release-plz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:
- name: Install git and gnupg
run: pacman -Syu --noconfirm git gnupg openssh

- name: Create non-root user
run: |
useradd -m builder
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
- name: Update PKGBUILD
run: |
version=$(grep '^version =' Cargo.toml | sed 's/.*= "\(.*\)"/\1/')
Expand All @@ -53,27 +48,23 @@ jobs:
- name: Generate .SRCINFO
run: |
chown -R builder:builder .
sudo -u builder makepkg --printsrcinfo > .SRCINFO
runuser -unobody makepkg --printsrcinfo > .SRCINFO
- name: Import GPG key
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
sudo -u builder bash << EOF
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
gpg-connect-agent reloadagent /bye
EOF
- name: Publish to AUR
env:
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
su builder
mkdir -p ~/.ssh
echo "$AUR_SSH_PRIVATE_KEY" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
Expand All @@ -90,4 +81,3 @@ jobs:
git add PKGBUILD .SRCINFO
echo $GPG_PASSPHRASE | git commit -S -m "Update to version $(grep -oP '(?<=pkgver=)\S+' PKGBUILD)"
git push
exit

0 comments on commit fdba1a5

Please sign in to comment.