Skip to content

Commit

Permalink
allow manual dispatch of tag action, error and abort if tag already e…
Browse files Browse the repository at this point in the history
…xists
  • Loading branch information
BenoitRanque committed Oct 16, 2024
1 parent 37ac650 commit 312777b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tag-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- closed
branches:
- main
workflow_dispatch:

jobs:
build:
Expand All @@ -28,6 +29,10 @@ jobs:
run: |
CARGO_VERSION="$(cargo metadata --format-version=1 | jq -r '.packages | .[] | select(.name == "ndc-clickhouse-cli") | .version')"
VERSION_TAG="v$CARGO_VERSION"
if git rev-parse "$VERSION_TAG" >/dev/null 2>&1; then
echo >&2 "Error: Tag '$VERSION_TAG' already exists."
exit 1
fi
echo "Tagging $VERSION_TAG"
git tag $VERSION_TAG
git push --tags
Expand Down

0 comments on commit 312777b

Please sign in to comment.