release 1.13.2: sticky version link to commit (no Forgejo tag 404)
Version badge href uses src/commit/<sha> for the exact run tree instead of src/tag/vX.Y.Z, which 404s when the tag is not yet on the remote.
This commit is contained in:
parent
1f1277b36a
commit
aa854b034a
5 changed files with 20 additions and 5 deletions
|
|
@ -101,8 +101,13 @@ case "$SUITE_VERSION" in
|
|||
unknown|v*) ;;
|
||||
*) SUITE_VERSION="v${SUITE_VERSION}" ;;
|
||||
esac
|
||||
# Sticky version badge: prefer commit URL (exact tree of this run).
|
||||
# Tag URLs (/src/tag/vX.Y.Z) 404 when the tag is not yet pushed to Forgejo;
|
||||
# commit URLs work as soon as main (or the tree) is on the remote.
|
||||
SUITE_VERSION_URL=""
|
||||
if [ -n "$SOURCE_REPO_WEB" ] && [ "$SUITE_VERSION" != "unknown" ]; then
|
||||
if [ -n "$SOURCE_REPO_WEB" ] && [ -n "${COMMIT:-}" ] && [ "$COMMIT" != "unknown" ]; then
|
||||
SUITE_VERSION_URL="${SOURCE_REPO_WEB}/src/commit/${COMMIT}"
|
||||
elif [ -n "$SOURCE_REPO_WEB" ] && [ "$SUITE_VERSION" != "unknown" ]; then
|
||||
SUITE_VERSION_URL="${SOURCE_REPO_WEB}/src/tag/${SUITE_VERSION}"
|
||||
fi
|
||||
export SUITE_VERSION SUITE_VERSION_URL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue