Skip to content

Commit 748595b

Browse files
committed
fix: improve release workflow conditions and artifact download
- Handle both refs/tags/* and v* tag formats in release conditions - Use run_id instead of commit for artifact download to ensure correct artifacts - Add better error handling for tag detection
1 parent ce0cb84 commit 748595b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
# Only run for successful builds on tags, or manual trigger
2424
if: |
2525
(github.event.workflow_run.conclusion == 'success' &&
26-
startsWith(github.event.workflow_run.head_branch, 'refs/tags/')) ||
26+
(startsWith(github.event.workflow_run.head_branch, 'refs/tags/') ||
27+
startsWith(github.event.workflow_run.head_branch, 'v'))) ||
2728
github.event_name == 'workflow_dispatch'
2829
steps:
2930
- uses: actions/checkout@v4
@@ -38,8 +39,10 @@ jobs:
3839
TAG_REF="${{ github.event.workflow_run.head_branch }}"
3940
if [[ "$TAG_REF" == refs/tags/* ]]; then
4041
echo "tag=${TAG_REF#refs/tags/}" >> $GITHUB_OUTPUT
42+
elif [[ "$TAG_REF" == v* ]]; then
43+
echo "tag=${TAG_REF}" >> $GITHUB_OUTPUT
4144
else
42-
echo "Error: Not triggered by a tag push"
45+
echo "Error: Not triggered by a tag push (got: $TAG_REF)"
4346
exit 1
4447
fi
4548
fi
@@ -48,7 +51,7 @@ jobs:
4851
uses: dawidd6/action-download-artifact@v3
4952
with:
5053
workflow: build.yml
51-
commit: ${{ github.sha }}
54+
run_id: ${{ github.event.workflow_run.id }}
5255
path: artifacts
5356

5457
- name: Organize release files

0 commit comments

Comments
 (0)