diff --git a/README.md b/README.md index 473aa22..56464ac 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ Glob patterns will be expanded by bash when copying the files to the repository. **Optional** Check that PKGBUILD could be built. +### `test_flags` + +**Optional** Command line flags for makepkg to build the package (if `test` is enabled). The default flags are `--clean --cleanbuild --nodeps`. + ### `commit_username` **Required** The username to use when creating the new commit. diff --git a/action.yml b/action.yml index 91d0f57..6ce6b01 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: description: 'Check that PKGBUILD could be built' required: false default: 'false' + test_flags: + description: 'Command line flags for makepkg to build the package (if `test` is enabled)' + required: false + default: '--clean --cleanbuild --nodeps' commit_username: description: 'The username to use when creating the new commit' required: true diff --git a/build.sh b/build.sh index 988b53e..dcd6db5 100755 --- a/build.sh +++ b/build.sh @@ -8,6 +8,7 @@ pkgbuild=$INPUT_PKGBUILD assets=$INPUT_ASSETS updpkgsums=$INPUT_UPDPKGSUMS test=$INPUT_TEST +read -r -a test_flags <<< "$INPUT_TEST_FLAGS" commit_username=$INPUT_COMMIT_USERNAME commit_email=$INPUT_COMMIT_EMAIL ssh_private_key=$INPUT_SSH_PRIVATE_KEY @@ -82,7 +83,7 @@ fi if [ "$test" == "true" ]; then echo '::group::Building package with makepkg' cd /tmp/local-repo/ - makepkg --clean --cleanbuild --nodeps + makepkg "${test_flags[@]}" echo '::endgroup::' fi diff --git a/entrypoint.sh b/entrypoint.sh index 6b012ba..a2d9894 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,6 +5,8 @@ set -o errexit -o pipefail -o nounset echo '::group::Creating builder user' useradd --create-home --shell /bin/bash builder passwd --delete builder +mkdir -p /etc/sudoers.d/ +echo "builder ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/builder echo '::endgroup::' echo '::group::Initializing SSH directory'