Skip to content

Commit 1eb82d4

Browse files
committed
Release only if CI succeeded on tag
1 parent a6f9eb3 commit 1eb82d4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ jobs:
1616
if: >
1717
${{
1818
github.event.workflow_run.conclusion == 'success' &&
19+
github.event.workflow_run.event == 'push' &&
1920
startsWith(github.event.workflow_run.head_branch, 'v')
2021
}}
2122
runs-on: ubuntu-latest
2223

2324
steps:
2425
- uses: actions/checkout@v4
26+
with:
27+
ref: ${{ github.event.workflow_run.head_sha }}
2528

2629
- name: Use Node.js 20.x
2730
uses: actions/setup-node@v4
@@ -55,8 +58,8 @@ jobs:
5558
- name: Create GitHub Release
5659
uses: softprops/action-gh-release@v2
5760
with:
58-
tag_name: ${{ github.ref }}
59-
name: Release ${{ github.ref }}
61+
tag_name: ${{ github.event.workflow_run.head_branch }}
62+
name: Release ${{ github.event.workflow_run.head_branch }}
6063
draft: false
6164
prerelease: false
6265
env:

0 commit comments

Comments
 (0)