From 237166e2bc08ca60f13aedf4a953f06baa6aa81f Mon Sep 17 00:00:00 2001 From: George <58841610+Shinji-IkariG@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:16:11 +0800 Subject: [PATCH] Update action.yml --- actions/tagname/action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/actions/tagname/action.yml b/actions/tagname/action.yml index 489f915..e5853aa 100644 --- a/actions/tagname/action.yml +++ b/actions/tagname/action.yml @@ -1,5 +1,9 @@ name: "Extract tag information" description: "Extract tag information" +inputs: + tag: + description: "Input tag (optional)" + required: false outputs: tag: description: "tag name" @@ -15,10 +19,16 @@ runs: steps: - id: tag run: | - tag=$(echo ${{ github.ref }} | rev | cut -d/ -f1 | rev) + if [ -n "$INPUT_TAG" ]; then + tag=$INPUT_TAG + else + tag=$(echo ${{ github.ref }} | rev | cut -d/ -f1 | rev) + fi tagnum=$(echo $tag | sed "s/^v//") majorver=$(echo $tag | cut -d "." -f 1) echo "tag=$tag" >> $GITHUB_OUTPUT echo "tagnum=$tagnum" >> $GITHUB_OUTPUT echo "majorver=$majorver" >> $GITHUB_OUTPUT shell: bash + env: + INPUT_TAG: ${{ inputs.tag }}