aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2021-11-07 21:10:19 +0800
committerKunoiSayami <[email protected]>2021-11-07 21:10:19 +0800
commitf10143ad493ef4ef71af7ab168f34ecc280ca5cc (patch)
treec6f48a372cda162ab02e72f29d32d9480d583216 /utils
parent254846d3da3f6c7fb70b316f5ebdf2ce4215309f (diff)
feat(script): Import gpg key only when push to master
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/pkgbuild.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/pkgbuild.sh b/utils/pkgbuild.sh
index 86965dd..1baa51f 100755
--- a/utils/pkgbuild.sh
+++ b/utils/pkgbuild.sh
@@ -62,9 +62,18 @@ function get_diff_list {
rm -f "${REPO_DIFF}_tmp"
}
-if [ $# -gt 0 ] && [ "$1" = "--diff" ]; then
- get_diff_list
- exit 0
+if [ $# -gt 0 ];then
+ if [ "$1" = "--diff" ]; then
+ get_diff_list
+ exit 0
+ elif [ "$1" = "--import-gpg" ]; then
+ if [ -n "$CI_DEFAULT_BRANCH" ] && [ -n "$CI_DEFAULT_BRANCH" ] && [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
+ echo $GPG_PRIV_KEY | base64 -d | gpg --import
+ else
+ echo -e "\033[0;32mSkip import gpg key\033[0m"
+ fi
+ exit 0
+ fi
fi
if [ "$EUID" -eq 0 ] ; then