diff --git a/README.md b/README.md index 56464ac..90c7fbc 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,10 @@ Glob patterns will be expanded by bash when copying the files to the repository. **Optional** Command line flags for makepkg to build the package (if `test` is enabled). The default flags are `--clean --cleanbuild --nodeps`. +### `post_process` + +**Optional** A line of commands to execute after processing the package. + ### `commit_username` **Required** The username to use when creating the new commit. diff --git a/action.yml b/action.yml index 6ce6b01..80aa20f 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,10 @@ inputs: description: 'Command line flags for makepkg to build the package (if `test` is enabled)' required: false default: '--clean --cleanbuild --nodeps' + post_process: + description: 'A line of commands to execute after processing the package' + required: false + default: '' commit_username: description: 'The username to use when creating the new commit' required: true diff --git a/build.sh b/build.sh index dcd6db5..334f319 100755 --- a/build.sh +++ b/build.sh @@ -9,6 +9,7 @@ assets=$INPUT_ASSETS updpkgsums=$INPUT_UPDPKGSUMS test=$INPUT_TEST read -r -a test_flags <<< "$INPUT_TEST_FLAGS" +post_process=$INPUT_POST_PROCESS commit_username=$INPUT_COMMIT_USERNAME commit_email=$INPUT_COMMIT_EMAIL ssh_private_key=$INPUT_SSH_PRIVATE_KEY @@ -92,6 +93,13 @@ cd /tmp/local-repo makepkg --printsrcinfo >.SRCINFO echo '::endgroup::' +if [ -n "$post_process" ]; then + echo '::group::Executing post process commands' + cd /tmp/local-repo/ + eval "$post_process" + echo '::endgroup::' +fi + echo '::group::Committing files to the repository' if [[ -z "$assets" ]]; then # When $assets are not set, we can add just PKGBUILD and .SRCINFO