From 8a5076c5707afccf2c297eab06816e95a13e2821 Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 19 Dec 2023 04:59:08 +0100 Subject: [PATCH] feat: add pre_package_hook input --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 9b37bfb..879f705 100644 --- a/action.yml +++ b/action.yml @@ -18,6 +18,9 @@ inputs: architecture: description: Architecture for which this package is built. Only relevant for the resulting filename. default: all + pre_package_hook: + description: Shell script to run right before invoking "dpkg-deb --build". + default: "" runs: using: docker image: docker://docker.io/library/debian:bookworm @@ -50,6 +53,7 @@ runs: [[ -f ${{ inputs.package_root }}/DEBIAN/prerm ]] && chmod +x ${{ inputs.package_root }}/DEBIAN/prerm [[ -f ${{ inputs.package_root }}/DEBIAN/postrm ]] && chmod +x ${{ inputs.package_root }}/DEBIAN/postrm sed -re "s/__VERSION__/${VERSION}-1/g" -i ${{ inputs.package_root }}/DEBIAN/control + ${{ inputs.pre_package_hook }} cd "${{ inputs.package_root }}/.." dpkg-deb --build $(basename ${{ inputs.package_root }}) mv "$(basename ${{ inputs.package_root }}).deb" "${GITHUB_WORKSPACE}/${{ inputs.package_output_path }}/${{ inputs.package_name }}_${VERSION}-1_${{ inputs.architecture }}.deb"