Skip to content

Commit bd18b87

Browse files
committed
fix: create releases for manual version bumps
1 parent fefc52c commit bd18b87

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737
git config --global user.email "github-actions[bot]@users.noreply.github.com"
3838
3939
- name: Ensure main branch is available
40-
run: git fetch origin main
40+
run: |
41+
git fetch origin main
42+
git fetch --tags
4143
4244
- name: Setup pnpm
4345
uses: pnpm/action-setup@v4
@@ -75,14 +77,25 @@ jobs:
7577

7678
- name: Get Version from Package.json
7779
id: version
78-
if: steps.changesets.outputs.hasChangesets == 'true'
7980
run: |
8081
VERSION=$(node -p "require('./package.json').version")
8182
echo "version=$VERSION" >> $GITHUB_OUTPUT
8283
echo "Version: $VERSION"
8384
85+
- name: Check if Release Tag Exists
86+
id: check_tag
87+
run: |
88+
TAG="v${{ steps.version.outputs.version }}"
89+
if git rev-parse "$TAG" >/dev/null 2>&1; then
90+
echo "tag_exists=true" >> $GITHUB_OUTPUT
91+
echo "Tag $TAG already exists"
92+
else
93+
echo "tag_exists=false" >> $GITHUB_OUTPUT
94+
echo "Tag $TAG does not exist, will create release"
95+
fi
96+
8497
- name: Create GitHub Release
85-
if: steps.changesets.outputs.hasChangesets == 'true' && steps.version.outputs.version != ''
98+
if: steps.version.outputs.version != '' && steps.check_tag.outputs.tag_exists == 'false'
8699
uses: actions/create-release@v1
87100
env:
88101
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

0 commit comments

Comments
 (0)