Skip to content

Commit e5a85eb

Browse files
fix: update release workflow to properly handle release events
1 parent 7bb323a commit e5a85eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ on:
55
tags:
66
- 'v*'
77
release:
8-
types: [created, edited]
8+
types: [published]
99

1010
jobs:
1111
build-and-publish:
1212
name: Build and publish
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16+
with:
17+
ref: ${{ github.event.release.tag_name || github.ref }}
1618

1719
- name: Setup Rust
1820
uses: actions-rs/toolchain@v1
@@ -150,7 +152,7 @@ jobs:
150152
name: Create GitHub Release
151153
runs-on: ubuntu-latest
152154
needs: build-binaries
153-
if: github.event_name == 'push' # Only create release when triggered by tag push
155+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') # Only create release when triggered by tag push
154156
steps:
155157
- uses: actions/checkout@v3
156158

0 commit comments

Comments
 (0)