云函数新增自定义执行index.js方式的secret
This commit is contained in:
6
.github/workflows/deploy_tencent_scf.yml
vendored
6
.github/workflows/deploy_tencent_scf.yml
vendored
@ -26,10 +26,11 @@ jobs:
|
||||
|
||||
- name: "将Secrets里面配置的变量添加到severless.yml里面作为环境变量"
|
||||
run: |
|
||||
if [ $SCF_REGION ]; then sed -i "s/region:.*$/region: $SCF_REGION/g" serverless.yml; fi;
|
||||
if [ $JD_COOKIE ]; then sed -i "/variables/a\ JD_COOKIE: $JD_COOKIE" serverless.yml; fi;
|
||||
if [ $JD_DEBUG ]; then sed -i "/variables/a\ JD_DEBUG: $JD_DEBUG" serverless.yml; fi;
|
||||
if [ $JD_USER_AGENT ]; then sed -i "/variables/a\ JD_USER_AGENT: $JD_USER_AGENT" serverless.yml; fi;
|
||||
if [ $TENCENTSCF_SOURCE_TYPE ]; then sed -i "/variables/a\ TENCENTSCF_SOURCE_TYPE: $TENCENTSCF_SOURCE_TYPE" serverless.yml; fi;
|
||||
if [ $TENCENTSCF_SOURCE_URL ]; then sed -i "/variables/a\ TENCENTSCF_SOURCE_URL: $TENCENTSCF_SOURCE_URL" serverless.yml; fi;
|
||||
if [ $PUSH_KEY ]; then sed -i "/variables/a\ PUSH_KEY: $PUSH_KEY" serverless.yml; fi;
|
||||
if [ $BARK_PUSH ]; then sed -i "/variables/a\ BARK_PUSH: $BARK_PUSH" serverless.yml; fi;
|
||||
if [ $BARK_SOUND ]; then sed -i "/variables/a\ BARK_SOUND: $BARK_SOUND" serverless.yml; fi;
|
||||
@ -94,10 +95,11 @@ jobs:
|
||||
cat serverless.yml
|
||||
env
|
||||
env: #因为直接读取secrets里面的值很多字符不会自动转译,导致写入serverless.yml异常,所以设置到环境变量,在读取环境变量转译过的值
|
||||
SCF_REGION: ${{ secrets.SCF_REGION }}
|
||||
JD_COOKIE: ${{ secrets.JD_COOKIE}}
|
||||
JD_DEBUG: ${{ secrets.JD_DEBUG}}
|
||||
JD_USER_AGENT: ${{ secrets.JD_USER_AGENT}}
|
||||
TENCENTSCF_SOURCE_TYPE: ${{ secrets.TENCENTSCF_SOURCE_TYPE}}
|
||||
TENCENTSCF_SOURCE_URL: ${{ secrets.TENCENTSCF_SOURCE_URL}}
|
||||
PUSH_KEY: ${{ secrets.PUSH_KEY}}
|
||||
BARK_PUSH: ${{ secrets.BARK_PUSH}}
|
||||
BARK_SOUND: ${{ secrets.BARK_SOUND}}
|
||||
|
Reference in New Issue
Block a user