1
0
mirror of https://github.com/rancher/cli.git synced 2026-02-06 21:48:05 +01:00
Files
cli/scripts/version
Enrico Candino ffe40feadf [v2.8][backport] Migrate from Drone to Github Actions, remove Dapper and add Darwin/arm64 support (#366)
* backport of #362

* avoid recursive find and inclusion of sha256sum.txt file in shasum

* added contents write permission to publish assets in release

* added comment
2024-05-23 17:37:16 +02:00

15 lines
309 B
Bash
Executable File

#!/bin/bash
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi
COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=${GITHUB_TAG:-$(git tag -l --contains HEAD | head -n 1)}
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
else
VERSION="${COMMIT}${DIRTY}"
fi