Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,10 @@ jobs:
set -euo pipefail
VERSION=$(python3 scripts/sync_versions.py --print)
TAG="packages/code-storage-go/v${VERSION}"
SOURCE_SHA=$(git rev-parse HEAD)
REMOTE_SHA=$(git ls-remote --tags origin "refs/tags/${TAG}" | cut -f1)

if [ -n "${REMOTE_SHA}" ] && [ "${REMOTE_SHA}" != "${SOURCE_SHA}" ]; then
echo "Tag ${TAG} already points to ${REMOTE_SHA}, not ${SOURCE_SHA}." >&2
exit 1
elif [ -n "${REMOTE_SHA}" ]; then
if git ls-remote --tags origin "refs/tags/${TAG}" | grep -q "refs/tags/${TAG}$"; then
SHOULD_TAG=false
echo "Tag ${TAG} already points to this commit; skipping."
echo "Tag ${TAG} already exists; skipping."
else
SHOULD_TAG=true
echo "Tag ${TAG} missing; creating and pushing."
Expand Down
Loading