-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WTF is happening with ../actions/latest-semantic-tag/action.yaml (#156)
Signed-off-by: Matthew Watkins <[email protected]>
- Loading branch information
1 parent
85b8993
commit 5762b6c
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |