Skip to content

Commit 0aee4aa

Browse files
committed
ci: add step to validate if tag exists or not
Signed-off-by: Andrew Brandt <[email protected]>
1 parent 9ded9e4 commit 0aee4aa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/flow-generate-release-notes.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ jobs:
5252
echo "Release identifier is valid: ${release_identifier}"
5353
echo "release-identifier=${release_identifier}" >> ${GITHUB_OUTPUT}
5454
55+
- name: Validate Tag Exists
56+
run: |
57+
tag="v${{ steps.validate.outputs.release-identifier }}"
58+
59+
echo "Checking if tag ${tag} exists..."
60+
61+
# Check if the tag exists in the repository
62+
git fetch --tags
63+
64+
if git rev-parse "$tag" >/dev/null 2>&1; then
65+
echo "Tag '${tag}' found."
66+
else
67+
echo "Error: Tag '${tag}' does not exist."
68+
exit 1
69+
fi
70+
5571
- name: Checkout Code
5672
id: checkout_code
5773
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

0 commit comments

Comments
 (0)