From d3c20ccdc73b4c4b487113aeda5f7d44523a38f2 Mon Sep 17 00:00:00 2001 From: shylocks Date: Mon, 25 Jan 2021 11:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E7=9A=84=E4=BA=91=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy_tencent_scf.yml | 2 ++ tencentscf.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_tencent_scf.yml b/.github/workflows/deploy_tencent_scf.yml index 70d6d17e..1e428b09 100644 --- a/.github/workflows/deploy_tencent_scf.yml +++ b/.github/workflows/deploy_tencent_scf.yml @@ -166,3 +166,5 @@ jobs: SERVERLESS_PLATFORM_VENDOR: tencent TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }} TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }} + TENCENT_REGION: ${{ secrets.TENCENT_REGION }} + TENCENT_FUNCTION_NAME: ${{ secrets.TENCENT_FUNCTION_NAME }} diff --git a/tencentscf.js b/tencentscf.js index ca20172c..f5d23e02 100644 --- a/tencentscf.js +++ b/tencentscf.js @@ -11,7 +11,7 @@ const clientConfig = { secretId: process.env.TENCENT_SECRET_ID, secretKey: process.env.TENCENT_SECRET_KEY, }, - region: "ap-hongkong", + region: process.env.TENCENT_REGION, // 区域参考,https://cloud.tencent.com/document/product/213/6091 profile: { httpProfile: { endpoint: "scf.tencentcloudapi.com", @@ -22,7 +22,7 @@ const clientConfig = { const client = new ScfClient(clientConfig); const params = { "Handler": "index.main_handler", - "FunctionName": "jd", + "FunctionName": process.env.TENCENT_FUNCTION_NAME, // 云函数程序名,例如 jd_scripts "ZipFile": contents_in_base64 }; client.UpdateFunctionCode(params).then(