Skip to content

Commit f71673b

Browse files
authored
Use remote check for tag and force-with-lease for branch to allow release run after dryrun (#675)
1 parent 23ec39c commit f71673b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ jobs:
109109
if ! git diff --cached --quiet; then
110110
git commit -m "chore: bump version to $VERSION"
111111
fi
112-
if git rev-parse "$VERSION" >/dev/null 2>&1; then
113-
echo "Tag $VERSION already exists, skipping"
112+
if git ls-remote --tags origin "$VERSION" | grep -q "$VERSION"; then
113+
echo "Tag $VERSION already exists on remote, skipping"
114114
else
115115
git tag "$VERSION"
116116
git push origin "$VERSION"
117117
fi
118-
git push origin "$BRANCH"
118+
git push origin "$BRANCH" --force-with-lease
119119
120120
- name: Create PR to merge version bump back to main
121121
if: ${{ !inputs.dry_run }}

0 commit comments

Comments
 (0)