From 8500edef5b0600d53470e2d03c763ff4308434b5 Mon Sep 17 00:00:00 2001 From: Tibrella Date: Sat, 9 Sep 2023 10:45:26 +0800 Subject: [PATCH] feat: custom makepkg.conf path --- action.yaml | 4 ++++ entrypoint.sh | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 8aa2012..fe22cb1 100644 --- a/action.yaml +++ b/action.yaml @@ -25,6 +25,10 @@ inputs: description: "Additional arguments to pass to makepkg." required: false default: "" + makepkgProfilePath: + description: "path of makepkg.conf" + required: false + default: "" outputs: pkgfile0: description: "Filename of the first generated package archive. Usually only one." diff --git a/entrypoint.sh b/entrypoint.sh index aa4fe33..27516a3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,7 +32,13 @@ chown -R builder . # INPUT_MAKEPKGARGS is intentionally unquoted to allow arg splitting # shellcheck disable=SC2086 pacman -S --noconfirm --needed paru -sudo -H -u builder updpkgsums + +if test -z "${INPUT_MAKEPKGPROFILEPATH}";then + echo "Didn't provide makepkg profile path. Skipped." +else + sudo -H -u builder install -D /etc/makepkg.conf ~/.config/pacman/makepkg.conf # 怕出权限问题所以先传统方式安装 + sudo -H -u cat ${INPUT_MAKEPKGPROFILEPATH} > ~/.config/pacman/makepkg.conf +fi sudo -H -u builder paru -U --noconfirm --mflags "${INPUT_MAKEPKGARGS:-}" # Get array of packages to be built