diff --git a/.gitea/scripts/build.sh b/.gitea/scripts/build.sh index 9742362..f26717c 100755 --- a/.gitea/scripts/build.sh +++ b/.gitea/scripts/build.sh @@ -13,6 +13,14 @@ if [[ -z "$BRANCH" && "$REF_TYPE" == "branch" ]]; then BRANCH="$REF_NAME" fi +# Determine last tag and commits since +LAST_TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)" +if [[ -n "$LAST_TAG" ]]; then + COMMITS_SINCE_LAST_RELEASE="$(git rev-list --count "${LAST_TAG}..HEAD")" +else + COMMITS_SINCE_LAST_RELEASE="0" +fi + cat >app/static/git.json <app/static/git.json <Commit: {git.sha.slice(0, 7)} – {git.commit_message}

+

+ Commits since last release: + {git.commits_since_last_release} +

Timestamp: {new Date(git.commit_timestamp).toLocaleString()}