Skip to content

Commit 1a6a613

Browse files
authored
Feature/create release (#170)
* feat: add check for existing tags before creating new ones * fix: handle existing tags in release creation * fix: remove unnecessary condition on tag creation step
1 parent 23e0370 commit 1a6a613

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/reusable-create-release.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,15 @@ jobs:
8585
run: |
8686
git config --global url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"
8787
88-
- name: Check if Tag Already Exists
89-
id: check-tag
88+
- name: Delete Existing Tag
9089
env:
9190
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9291
run: |
93-
if git ls-remote --tags origin ${{ inputs.tag }} | grep -q ${{ inputs.tag }}; then
94-
echo "exists=1" >> "$GITHUB_OUTPUT"
95-
fi
92+
echo "Tag '${{ inputs.tag }}' already exists. Deleting it..."
93+
git tag -d ${{ inputs.tag }} || echo "Local tag not found."
94+
git push --delete origin ${{ inputs.tag }}
9695
9796
- name: Create Tag
98-
if: ${{ steps.check-tag.outputs.exists == '1' }}
9997
env:
10098
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
10199
run: |

0 commit comments

Comments
 (0)