Skip to content

Commit 10fcb55

Browse files
Fetch all git data for embedding correct version in docker image (#25361) (#25373)
Backport #25361 by @techknowlogick Fix #25350 Co-authored-by: techknowlogick <[email protected]>
1 parent e9105ac commit 10fcb55

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/release-nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ jobs:
5555
runs-on: ubuntu-latest
5656
steps:
5757
- uses: actions/checkout@v3
58+
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
59+
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
60+
- run: git fetch --unshallow --quiet --tags --force
5861
- uses: docker/setup-qemu-action@v2
5962
- uses: docker/setup-buildx-action@v2
6063
- name: Get cleaned branch name

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ endif
7979
STORED_VERSION_FILE := VERSION
8080
HUGO_VERSION ?= 0.111.3
8181

82+
GITHUB_REF_TYPE ?= branch
83+
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
84+
8285
ifneq ($(GITHUB_REF_TYPE),branch)
8386
VERSION ?= $(subst v,,$(GITHUB_REF_NAME))
8487
GITEA_VERSION ?= $(GITHUB_REF_NAME)

0 commit comments

Comments
 (0)