From 3ffc0dab8cd10fe903301825b84c02cca2ce259f Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Wed, 3 Jan 2024 13:51:41 +0800 Subject: [PATCH] app-pipeline-renew-ssl-cert: Fixed aliyun api key and secre is empty --- .github/workflows/use-renew-ssl-certs.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/use-renew-ssl-certs.yml b/.github/workflows/use-renew-ssl-certs.yml index 01da4825..40977e8c 100644 --- a/.github/workflows/use-renew-ssl-certs.yml +++ b/.github/workflows/use-renew-ssl-certs.yml @@ -34,6 +34,18 @@ jobs: - name: Renew SSL Cert run: | set -x + + # 检查参数是否为空 + check_not_empty() { + if [[ -z $1 ]]; then + echo "Error: $2 is empty. Please provide a value." + exit 1 + fi + } + # 检查参数是否为空 + check_not_empty "$DNS_AK" "DNS_AK" Ali_Key=$DNS_AK + check_not_empty "$DNS_SK" "DNS_SK" Ali_Secret=$DNS_SK + rm -fv ${DOMAIN}.key ${DOMAIN}.pem -f rm -fv /etc/ssl/${DOMAIN}.* -f # Try to issue a certificate from ZeroSSL. If it fails, try Let's Encrypt.