File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -134,19 +134,22 @@ jobs:
134134
135135          git tag "$TAG" 
136136
137-           if git push origin "$TAG"; then 
138-             echo "Pushed tag $TAG to origin." 
139-             exit 0 
140-           fi 
141- 
142-           echo "Push failed, re-checking remote for $TAG..." 
143-           if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then 
144-             echo "Tag $TAG is present on origin after push attempt; continuing." 
145-             exit 0 
137+           set +e 
138+           git push origin "$TAG" 
139+           PUSH_STATUS=$? 
140+           set -e 
141+ 
142+           if [ "$PUSH_STATUS" -ne 0 ]; then 
143+             echo "Push failed, re-checking remote for $TAG..." 
144+             if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then 
145+               echo "Tag $TAG is present on origin after push attempt; continuing." 
146+               exit 0 
147+             fi 
148+             echo "Failed to push tag $TAG and it is not present on origin." 
149+             exit 1 
146150          fi 
147151
148-           echo "Failed to push tag $TAG and it is not present on origin." 
149-           exit 1 
152+           echo "Pushed tag $TAG to origin." 
150153
151154       - name : Upload staging metadata 
152155        uses : actions/upload-artifact@v4 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments