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(