Parcourir la source

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 il y a 11 mois
Parent
commit
9939f8ca3a
1 fichiers modifiés avec 2 ajouts et 5 suppressions
  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: |