Skip to content

Commit

Permalink
Fix the create release - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Dec 6, 2024
1 parent 9d69435 commit 4ec4ce6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ run-name: Create Release

on:
workflow_dispatch:
inputs:
tag_name:
description: 'The tag name to release'
default: ''
required: false
type: string
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+"
Expand Down Expand Up @@ -30,14 +36,14 @@ jobs:
- name: Extract tag and Details
id: release
run: |
echo "GITHUB_REF: ${GITHUB_REF}"
echo "GITHUB_REF_TYPE: ${GITHUB_REF_TYPE}"
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
TAG_NAME="${{ inputs.tag_name }}"
if [[ -z "$TAG_NAME" && "${GITHUB_REF_TYPE}" == "tag" ]]; then
TAG_NAME="${GITHUB_REF#refs/tags/}"
else
TAG_NAME="$(git tag | tail -n 1)"
if [[ -z "${TAG_NAME}" ]]; then
echo "No tags found: ${TAG_NAME}"
TAG_NAME="${TAG_NAME:-$(git tag | tail -n 1)}"
if [[ -z "$TAG_NAME" ]]; then
echo "No tags found!"
git tag
exit 1
fi
fi
Expand Down

0 comments on commit 4ec4ce6

Please sign in to comment.