Skip to content

Commit

Permalink
check for duplicate tags
Browse files Browse the repository at this point in the history
  • Loading branch information
yshavit committed Mar 2, 2025
1 parent ab374bf commit 1c13c96
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/prepare-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
with:
ref: ${{ github.event.inputs.base_ref }}

- name: Check that tag is available
run: |
if git release view "$TAG_NAME" ; then
echo "::error ::tag $TAG_NAME already exists"
exit 1
fi
env:
TAG_NAME: "v${{ github.event.inputs.current_version }}"

- name: Prepare random dir
id: random-dir
run: echo "path=$(mktemp -d)" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -83,7 +92,7 @@ jobs:
- name: Create new release
id: create_release
run: |
release_url="$(gh release create "v${{ github.event.inputs.new_version }}" --draft --title "v${{ github.event.inputs.new_version }}" --generate-notes --target "$TARGET_REF")"
release_url="$(gh release create "v${{ github.event.inputs.current_version }}" --draft --title "v${{ github.event.inputs.current_version }}" --generate-notes --target "$TARGET_REF")"
echo "release_url=$release_url" >> "$GITHUB_OUTPUT"
env:
TARGET_REF: ${{ github.event.inputs.base_ref }}
Expand Down

0 comments on commit 1c13c96

Please sign in to comment.