if tag exists return tag
This commit is contained in:
7
.github/actions/bump-version/action.yaml
vendored
7
.github/actions/bump-version/action.yaml
vendored
@@ -38,6 +38,13 @@ runs:
|
|||||||
id: bump
|
id: bump
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
EXISTING_TAG="$(git tag --points-at HEAD "v*" | head -n 1)"
|
||||||
|
if [ -n "${EXISTING_TAG}" ]; then
|
||||||
|
echo "Tag ${EXISTING_TAG} already points at this commit; skipping bump."
|
||||||
|
echo "tag=${EXISTING_TAG}" >> "${GITHUB_OUTPUT}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
REF="${GITHUB_REF:-${GITEA_REF}}"
|
REF="${GITHUB_REF:-${GITEA_REF}}"
|
||||||
BRANCH="${REF#refs/heads/}"
|
BRANCH="${REF#refs/heads/}"
|
||||||
git fetch origin "${BRANCH}" --tags
|
git fetch origin "${BRANCH}" --tags
|
||||||
|
|||||||
Reference in New Issue
Block a user