Skip to content

Commit 379dbc2

Browse files
committed
Fix release workflow: add explicit tag_name for GitHub Release
The softprops/action-gh-release action requires an explicit tag_name when triggered via workflow_run, because github.ref in that context points to refs/heads/master (a branch), not the tag. Without tag_name, the action fails with: "GitHub Releases requires a tag" This fix adds tag_name using the version from the identifiers workflow, which correctly detected the tag via git describe --tags --exact-match. Note: This work was completed with AI assistance (Claude Code).
1 parent 010bf8d commit 379dbc2

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,25 @@ jobs:
282282
echo "version=$VERSION" >> $GITHUB_OUTPUT
283283
echo "Version: $VERSION"
284284
285+
# IMPORTANT: tag_name MUST be explicitly specified here!
286+
#
287+
# When this workflow runs via workflow_run trigger (after the main workflow
288+
# completes), github.ref is "refs/heads/master" (a branch), NOT the tag.
289+
# This is because workflow_run context inherits from the triggering workflow's
290+
# context, and even though the main workflow was triggered by a tag push,
291+
# the github.ref in the workflow_run context points to the default branch.
292+
#
293+
# The softprops/action-gh-release action defaults to using github.ref for
294+
# the tag name when tag_name is not specified. Since github.ref is a branch
295+
# (not a tag), the action fails with: "GitHub Releases requires a tag"
296+
#
297+
# Solution: Explicitly pass tag_name using the version extracted from
298+
# the identifiers workflow, which correctly detected the tag via
299+
# `git describe --tags --exact-match` on the head_sha.
285300
- name: Create GitHub Release
286301
uses: softprops/action-gh-release@v2
287302
with:
303+
tag_name: v${{ steps.get_version.outputs.version }}
288304
name: v${{ steps.get_version.outputs.version }}
289305
body: |
290306
## txaio v${{ steps.get_version.outputs.version }}

0 commit comments

Comments
 (0)