Skip to content

Commit 8066e85

Browse files
committed
release on published event
1 parent 3b0ed57 commit 8066e85

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Release
33
on:
44
push:
55
branches: [main]
6-
tags:
7-
- 'v*'
6+
release:
7+
types: [published]
88

99
permissions:
1010
contents: read
@@ -30,8 +30,9 @@ jobs:
3030
SHA_SHORT=$(git rev-parse --short HEAD)
3131
echo "SHA_SHORT=$SHA_SHORT" >> $GITHUB_ENV
3232
33-
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
34-
VERSION=${GITHUB_REF#refs/tags/v}
33+
if [[ "${{ github.event_name }}" == "release" ]]; then
34+
VERSION=${{ github.event.release.tag_name }}
35+
VERSION=${VERSION#v}
3536
else
3637
VERSION=0.0.0-insiders.$SHA_SHORT
3738
fi
@@ -56,7 +57,7 @@ jobs:
5657
echo "RELEASE_CHANNEL=$(node ./scripts/release-channel.js $VERSION)" >> $GITHUB_ENV
5758
5859
- name: Version package for insiders release
59-
if: github.ref_type != 'tag'
60+
if: github.event_name != 'release'
6061
run: pnpm version ${{ env.VERSION }} --force --no-git-tag-version
6162

6263
- name: Build Prettier Plugin

0 commit comments

Comments
 (0)