You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a231a20
Browse filesBrowse the repository at this point in the historyBrowse files
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
48
-
VERSION="${{ inputs.version }}"
50
+
TAG="${{ inputs.version }}"
49
51
else
50
-
# Strip 'v' prefix from tag: v1.2.3 -> 1.2.3
51
-
VERSION="${GITHUB_REF_NAME#v}"
52
+
# Read the tag from the release payload, NOT $GITHUB_REF_NAME: when a
53
+
# release is published from a draft, the ref can resolve to the
54
+
# default branch (main) instead of the tag, yielding an empty version.
55
+
TAG="${{ github.event.release.tag_name }}"
56
+
fi
57
+
# Strip optional leading 'v': v1.2.3 -> 1.2.3
58
+
VERSION="${TAG#v}"
59
+
if [ -z "$VERSION" ]; then
60
+
echo "::error::Could not determine a version to publish (event=${{ github.event_name }}, tag='${TAG}'). An empty VersionPrefix would override the default 1.0.0 and break 'dotnet pack'."
0 commit comments