Skip to content

Commit 2a8c14a

Browse files
committed
fix tag step in publish
1 parent 4d5b655 commit 2a8c14a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,22 @@ jobs:
6161
- name: Create git tag if missing
6262
run: |
6363
TAG="${{ steps.pkg.outputs.tag }}"
64-
git fetch --tags
64+
65+
# Get latest refs safely
66+
git fetch --tags origin
67+
git fetch origin main
68+
69+
# Work on the remote tip to avoid local-branch/upstream issues
70+
git checkout --detach origin/main
71+
72+
# Create annotated tag if it doesn't already exist
6573
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
6674
echo "Tag $TAG already exists, continuing."
6775
else
68-
git fetch origin main:main
69-
git checkout main
70-
git pull --ff-only
7176
git tag -a "$TAG" -m "Release $TAG"
7277
git push origin "$TAG"
7378
fi
74-
79+
7580
- name: Create or Update GitHub Release
7681
id: release
7782
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)