Skip to content

Commit fe75f84

Browse files
Copilotdata-douser
andcommitted
Enable auto-creation of tags in release workflow for workflow_dispatch
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
1 parent f0418cc commit fe75f84

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
echo "version=${VERSION}" >> $GITHUB_OUTPUT
5959
echo "release_name=${VERSION#v}" >> $GITHUB_OUTPUT
6060
61-
- name: Release - Checkout tag for workflow_dispatch
61+
- name: Release - Checkout or create tag for workflow_dispatch
6262
if: github.event_name == 'workflow_dispatch'
6363
run: |
6464
# For workflow_dispatch, we need to checkout the specific tag
@@ -67,8 +67,11 @@ jobs:
6767
echo "Checking out existing tag: ${TAG}"
6868
git checkout "refs/tags/${TAG}"
6969
else
70-
echo "::error::Tag '${TAG}' does not exist. Create the tag first before running this workflow."
71-
exit 1
70+
echo "Tag '${TAG}' does not exist. Creating it now..."
71+
CURRENT_SHA=$(git rev-parse HEAD)
72+
git tag "${TAG}" "${CURRENT_SHA}"
73+
git push origin "${TAG}"
74+
echo "✅ Created and pushed tag: ${TAG} at commit ${CURRENT_SHA:0:8}"
7275
fi
7376
7477
- name: Release - Verify checkout matches expected version

0 commit comments

Comments
 (0)