Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinji-IkariG authored Nov 22, 2024
1 parent 935f5ca commit 237166e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion actions/tagname/action.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 }}

0 comments on commit 237166e

Please sign in to comment.