This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 73f9017f fix workflow v16
73f9017f is described below

commit 73f9017f1a35d73614497d2ff1c1ee86c2bf7990
Author: mfordjody <[email protected]>
AuthorDate: Sat May 31 20:53:20 2025 +0800

    fix workflow v16
---
 .github/workflows/dubboctl-release.yaml | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/dubboctl-release.yaml 
b/.github/workflows/dubboctl-release.yaml
index 0d3c7a32..cbe7b9a7 100644
--- a/.github/workflows/dubboctl-release.yaml
+++ b/.github/workflows/dubboctl-release.yaml
@@ -22,7 +22,7 @@ name: dubboctl Release
 on:
   push:
     tags:
-      - 'dubboctl-*'
+      - "dubboctl-*"
 
 jobs:
   release:
@@ -30,6 +30,7 @@ jobs:
     permissions:
       contents: write
     runs-on: ubuntu-latest
+
     strategy:
       matrix:
         goos: [linux, darwin]
@@ -74,10 +75,27 @@ jobs:
             echo "name=${FILENAME}.tar.gz" >> $GITHUB_OUTPUT
           fi
 
+      - name: Get existing release by tag
+        id: get_release
+        uses: actions/github-script@v7
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          script: |
+            const tag = context.ref.replace('refs/tags/', '');
+            const release = await github.rest.repos.getReleaseByTag({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              tag: tag
+            });
+            return release.data.upload_url;
+
       - name: Upload Release Asset
         uses: actions/upload-release-asset@v1
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         with:
-          upload_url: ${{ github.event.release.upload_url }}
+          upload_url: ${{ steps.get_release.outputs.result }}
           asset_path: ./build/${{ steps.package.outputs.name }}
           asset_name: ${{ steps.package.outputs.name }}
           asset_content_type: application/octet-stream
+

Reply via email to