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
16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Setup Node and dependencies
uses: ./.github/actions/setup-node
Expand Down Expand Up @@ -51,7 +49,11 @@ jobs:
env:
GIT_TAG: v${{ steps.plan.outputs.version }}
run: |
existing_commit="$(git rev-list -n 1 "$GIT_TAG" 2>/dev/null || true)"
tag_ref="refs/tags/$GIT_TAG"
existing_commit="$(git ls-remote origin "$tag_ref^{}" | cut -f1)"
if [[ -z "$existing_commit" ]]; then
existing_commit="$(git ls-remote origin "$tag_ref" | cut -f1)"
fi
if [[ -n "$existing_commit" && "$existing_commit" != "$GITHUB_SHA" ]]; then
echo "$GIT_TAG already points to $existing_commit, not $GITHUB_SHA." >&2
exit 1
Expand Down Expand Up @@ -79,16 +81,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Create Git tag
env:
GIT_TAG: v${{ needs.release-plan.outputs.version }}
GIT_USER_EMAIL: ${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com
GIT_USER_NAME: ${{ github.actor }}
run: |
existing_commit="$(git rev-list -n 1 "$GIT_TAG" 2>/dev/null || true)"
tag_ref="refs/tags/$GIT_TAG"
existing_commit="$(git ls-remote origin "$tag_ref^{}" | cut -f1)"
if [[ -z "$existing_commit" ]]; then
existing_commit="$(git ls-remote origin "$tag_ref" | cut -f1)"
fi
if [[ -z "$existing_commit" ]]; then
git \
-c user.name="$GIT_USER_NAME" \
Expand Down