From d1487baa28b448cf90ed3cde80c14c46abc90ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E9=AD=8F=E6=B4=AA?= Date: Wed, 6 Nov 2024 18:43:04 +0800 Subject: [PATCH] fix:invoke return --- .github/workflows/registry-publish.yml | 13 ++++++++----- publish.yaml | 2 +- src/code/app.py | 6 ++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/registry-publish.yml b/.github/workflows/registry-publish.yml index c1c1c2a..1665e86 100644 --- a/.github/workflows/registry-publish.yml +++ b/.github/workflows/registry-publish.yml @@ -1,14 +1,17 @@ name: publish package to registry on: - release: - types: [created] + push: + branches: + - V3 jobs: - deploy: + release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - run: git config --global core.symlinks false + shell: bash + - uses: actions/checkout@v4 - uses: actions/setup-node@v2 with: node-version: 16 @@ -25,4 +28,4 @@ jobs: s registry login --token ${{ secrets.alibaba_registry_v3_publish_token }} - name: release prod run: | - s registry publish \ No newline at end of file + s registry publish diff --git a/publish.yaml b/publish.yaml index 5e3b93e..821f457 100644 --- a/publish.yaml +++ b/publish.yaml @@ -3,7 +3,7 @@ Type: Project Name: start-word2pdf-v3 Provider: - 阿里云 -Version: 0.0.6 +Version: 0.0.7 Description: 本案例是将 word 转 pdf 的逻辑封装成一个python函数,快速创建并部署到阿里云函数计算 FC。 HomePage: https://github.com/devsapp/start-word2pdf Organization: 阿里云函数计算(FC) diff --git a/src/code/app.py b/src/code/app.py index b324e9a..a94a92d 100644 --- a/src/code/app.py +++ b/src/code/app.py @@ -159,9 +159,11 @@ def invoke(): # subprocess.check_call(["ls", "-ll", "/tmp"]) print("FC Invoke End RequestId: " + request_id) if result.status == 200: - return "upload to oss success!" + print("upload to oss success!") + return {"code": "Success"} else: - return "upload fail, error code %s " % result.status + print("upload fail, error code %s " % result.status) + return {"code": "Failed"} except Exception as e: exc_info = sys.exc_info()