fix: add user directly into sudoers file

This commit is contained in:
Ahmad Husen
2022-02-01 23:56:42 +07:00
parent 6443f058c1
commit 360be955b0
5 changed files with 34 additions and 24 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ jobs:
cat action.yml cat action.yml
- name: Get sample PKGBUILD - name: Get sample PKGBUILD
run: wget https://github.com/datakrama/plenti-bin/raw/f5ffaaee02a2119aa16f6b7a27e87e198e096b47/PKGBUILD run: wget https://github.com/hapakaien/plenti-bin/raw/f5ffaaee02a2119aa16f6b7a27e87e198e096b47/PKGBUILD
- name: Running test - name: Running test
uses: ./ uses: ./
@@ -95,7 +95,7 @@ jobs:
uses: actions/checkout@v2.4.0 uses: actions/checkout@v2.4.0
- name: Get sample PKGBUILD - name: Get sample PKGBUILD
run: wget https://github.com/datakrama/plenti-bin/raw/f5ffaaee02a2119aa16f6b7a27e87e198e096b47/PKGBUILD run: wget https://github.com/hapakaien/plenti-bin/raw/f5ffaaee02a2119aa16f6b7a27e87e198e096b47/PKGBUILD
- name: Update action.yml to use edge tagged container image - name: Update action.yml to use edge tagged container image
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
+9
View File
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Changed
- Move repo from datakrama to hapakaien
- `builder` user is added to sudoers directly instead of via the wheel group
### Fixed
- `builder` is not in the sudoers file
## [1.1.1] - 2021-10-26 ## [1.1.1] - 2021-10-26
### Fixed ### Fixed
+4 -5
View File
@@ -5,11 +5,10 @@ FROM docker.io/library/archlinux:base-devel
RUN pacman -Syu --needed --noconfirm pacman-contrib namcap git RUN pacman -Syu --needed --noconfirm pacman-contrib namcap git
# Setup user # Setup user
RUN useradd --create-home --shell /bin/bash builder && \ RUN useradd -m builder && \
passwd --delete builder && \ echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
chown -vR builder:builder /home/builder && \ WORKDIR /home/builder
usermod -aG wheel builder && \ USER builder
echo 'wheel ALL=(ALL:ALL) ALL' >> /etc/sudoers
# Copy files # Copy files
COPY LICENSE README.md / COPY LICENSE README.md /
+5 -5
View File
@@ -1,6 +1,6 @@
# Arch Linux's package tools action # Arch Linux's package tools action
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/datakrama/archlinux-package-action/CI?label=CI&style=flat-square)](https://github.com/datakrama/archlinux-package-action/actions) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/datakrama/archlinux-package-action?style=flat-square)](https://github.com/datakrama/archlinux-package-action/releases) [![GitHub](https://img.shields.io/github/license/datakrama/archlinux-package-action?style=flat-square)](./LICENSE) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hapakaien/archlinux-package-action/CI?label=CI&style=flat-square)](https://github.com/hapakaien/archlinux-package-action/actions) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/hapakaien/archlinux-package-action?style=flat-square)](https://github.com/hapakaien/archlinux-package-action/releases) [![GitHub](https://img.shields.io/github/license/hapakaien/archlinux-package-action?style=flat-square)](./LICENSE)
This action allows running tools needed for creating Arch Linux (and AUR) package. This action allows running tools needed for creating Arch Linux (and AUR) package.
Here's what this action can do: Here's what this action can do:
@@ -52,7 +52,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v1
``` ```
#### 2. Only generate .SRCINFO #### 2. Only generate .SRCINFO
@@ -72,7 +72,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v1
with: with:
flags: '' flags: ''
namcap: false namcap: false
@@ -96,7 +96,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v1
with: with:
flags: '' flags: ''
namcap: false namcap: false
@@ -120,7 +120,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v1
with: with:
path: package path: package
flags: '-si --noconfirm' flags: '-si --noconfirm'
+14 -12
View File
@@ -2,13 +2,15 @@
set -e set -e
# Set path # Set path
echo "::group::Copying file from $WORKPATH to /tmp/gh-action"
WORKPATH=$GITHUB_WORKSPACE/$INPUT_PATH WORKPATH=$GITHUB_WORKSPACE/$INPUT_PATH
HOME=/home/builder
echo "::group::Copying files from $WORKPATH to $HOME/gh-action"
# Set path permision # Set path permision
sudo -u builder mkdir /tmp/gh-action cd $HOME
sudo -u builder cp -rfv "$GITHUB_WORKSPACE"/.git /tmp/gh-action/.git mkdir gh-action
sudo -u builder cp -fv "$WORKPATH"/PKGBUILD /tmp/gh-action/PKGBUILD cd gh-action
cd /tmp/gh-action cp -rfv "$GITHUB_WORKSPACE"/.git ./
sudo cp -fv "$WORKPATH"/PKGBUILD ./
echo "::endgroup::" echo "::endgroup::"
# Update pkgver # Update pkgver
@@ -30,7 +32,7 @@ fi
# Update checksums # Update checksums
if [[ $INPUT_UPDPKGSUMS == true ]]; then if [[ $INPUT_UPDPKGSUMS == true ]]; then
echo "::group::Updating checksums on PKGBUILD" echo "::group::Updating checksums on PKGBUILD"
sudo -u builder updpkgsums updpkgsums
git diff PKGBUILD git diff PKGBUILD
echo "::endgroup::" echo "::endgroup::"
fi fi
@@ -38,7 +40,7 @@ fi
# Generate .SRCINFO # Generate .SRCINFO
if [[ $INPUT_SRCINFO == true ]]; then if [[ $INPUT_SRCINFO == true ]]; then
echo "::group::Generating new .SRCINFO based on PKGBUILD" echo "::group::Generating new .SRCINFO based on PKGBUILD"
sudo -u builder makepkg --printsrcinfo > .SRCINFO makepkg --printsrcinfo > .SRCINFO
git diff .SRCINFO git diff .SRCINFO
echo "::endgroup::" echo "::endgroup::"
fi fi
@@ -53,13 +55,13 @@ fi
# Run makepkg # Run makepkg
if [[ -n $INPUT_FLAGS ]]; then if [[ -n $INPUT_FLAGS ]]; then
echo "::group::Running makepkg with flags" echo "::group::Running makepkg with flags"
sudo -u builder makepkg $INPUT_FLAGS makepkg $INPUT_FLAGS
echo "::endgroup::" echo "::endgroup::"
fi fi
echo "::group::Copying files from /tmp/gh-action to $WORKPATH" echo "::group::Copying files from $HOME/gh-action to $WORKPATH"
cp -fv /tmp/gh-action/PKGBUILD "$WORKPATH"/PKGBUILD sudo cp -fv PKGBUILD "$WORKPATH"/PKGBUILD
if [[ -e /tmp/gh-action/.SRCINFO ]]; then if [[ -e .SRCINFO ]]; then
cp -fv /tmp/gh-action/.SRCINFO "$WORKPATH"/.SRCINFO sudo cp -fv .SRCINFO "$WORKPATH"/.SRCINFO
fi fi
echo "::endgroup::" echo "::endgroup::"