Skip to content

Commit 065b605

Browse files
authored
Merge pull request #32 from fuljo/master
Add `test_flags` input
2 parents 325b53d + acad6af commit 065b605

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Glob patterns will be expanded by bash when copying the files to the repository.
2525

2626
**Optional** Check that PKGBUILD could be built.
2727

28+
### `test_flags`
29+
30+
**Optional** Command line flags for makepkg to build the package (if `test` is enabled). The default flags are `--clean --cleanbuild --nodeps`.
31+
2832
### `commit_username`
2933

3034
**Required** The username to use when creating the new commit.

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ inputs:
2323
description: 'Check that PKGBUILD could be built'
2424
required: false
2525
default: 'false'
26+
test_flags:
27+
description: 'Command line flags for makepkg to build the package (if `test` is enabled)'
28+
required: false
29+
default: '--clean --cleanbuild --nodeps'
2630
commit_username:
2731
description: 'The username to use when creating the new commit'
2832
required: true

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pkgbuild=$INPUT_PKGBUILD
88
assets=$INPUT_ASSETS
99
updpkgsums=$INPUT_UPDPKGSUMS
1010
test=$INPUT_TEST
11+
read -r -a test_flags <<< "$INPUT_TEST_FLAGS"
1112
commit_username=$INPUT_COMMIT_USERNAME
1213
commit_email=$INPUT_COMMIT_EMAIL
1314
ssh_private_key=$INPUT_SSH_PRIVATE_KEY
@@ -82,7 +83,7 @@ fi
8283
if [ "$test" == "true" ]; then
8384
echo '::group::Building package with makepkg'
8485
cd /tmp/local-repo/
85-
makepkg --clean --cleanbuild --nodeps
86+
makepkg "${test_flags[@]}"
8687
echo '::endgroup::'
8788
fi
8889

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set -o errexit -o pipefail -o nounset
55
echo '::group::Creating builder user'
66
useradd --create-home --shell /bin/bash builder
77
passwd --delete builder
8+
mkdir -p /etc/sudoers.d/
9+
echo "builder ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/builder
810
echo '::endgroup::'
911

1012
echo '::group::Initializing SSH directory'

0 commit comments

Comments
 (0)