Преглед изворни кода

ci: simplify tag generation in GitHub workflow

Remove redundant git tag creation and push steps since they are handled elsewhere in the workflow. Also improve tag generation by handling empty tag responses gracefully.
TheWildJames пре 11 месеци
родитељ
комит
9939f8ca3a
1 измењених фајлова са 2 додато и 5 уклоњено
  1. 2 5
      .github/workflows/main.yml

+ 2 - 5
.github/workflows/main.yml

@@ -166,10 +166,10 @@ jobs:
           echo "BBG_REF=$BBG_REF" >> $GITHUB_ENV
           echo "BBG_URL=$BBG_URL" >> $GITHUB_ENV
 
-      - name: Generate and Create New Tag
+      - name: Generate New Tag
         if: inputs.release_type != 'Actions'
         run: |
-            LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name')
+            LATEST_TAG=$(gh api repos/${{ github.repository }}/tags --jq '.[0].name' 2>/dev/null || echo "")
             if [ -z "$LATEST_TAG" ]; then
               LATEST_TAG="v1.5.12-r0"
             fi
@@ -179,9 +179,6 @@ jobs:
             echo "New tag: $NEW_TAG"
             echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
 
-            git tag $NEW_TAG
-            git push origin $NEW_TAG
-
       - name: Set tag for Actions only
         if: inputs.release_type == 'Actions'
         run: |