File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 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 }}
You can’t perform that action at this time.
0 commit comments