Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test_flags input #32

Merged
merged 4 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}"
KSXGitHub marked this conversation as resolved.
Show resolved Hide resolved
echo '::endgroup::'
fi

Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
KSXGitHub marked this conversation as resolved.
Show resolved Hide resolved
echo '::endgroup::'

echo '::group::Initializing SSH directory'
Expand Down