Skip to content

Commit

Permalink
WTF is happening with ../actions/latest-semantic-tag/action.yaml (#156)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Watkins <[email protected]>
  • Loading branch information
ModeSevenIndustrialSolutions authored Aug 1, 2024
1 parent 85b8993 commit 5762b6c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/actions/latest-semantic-tag/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation <https://linuxfoundation.org>

name: "🏷️ Latest Semantic Tag"

outputs:
latest-tag:
description: "Return the latest semantic tag from local repository"
value: ${{ steps.parse-tags.outputs.latest-tag }}

runs:
using: "composite"
steps:
- id: parse-tags
name: "Determine latest semantic tag"
shell: bash
run: |
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.head_ref: ${{ github.head_ref }}"
LATEST_TAG=$(git tag -l --sort=committerdate | grep -o 'v.*' | sort -r | head -1)
if [ -z "$LATEST_TAG" ]; then
echo "No tags with semantic versioning were found in the repository"; exit 1
else
echo "latest-tag=$LATEST_TAG" >> "$GITHUB_OUTPUT"
echo "Latest semantic tag = $LATEST_TAG"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.head_ref: ${{ github.head_ref }}"
fi

0 comments on commit 5762b6c

Please sign in to comment.