From a6e2d5d0c12ebfab65c94f1bba83119916053c39 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 24 Jan 2024 12:44:29 +0100 Subject: [PATCH] ghactions: Adjust action so that versioning works For `git describe` to work on non-tag pushes, we need the repo history/tags, a shallow clone with just the latest commit won't be enough. There's also a bug in actions/checkout for tag pushes, the tag is overridden with a non-tag, which breaks `git describe` for the tag. This commit adds a workaround for this. Signed-off-by: Christophe Fergeau --- .github/workflows/compile.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 44be278c..f6627b9f 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -21,6 +21,15 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: >- + WORKAROUND: Fetch tags that points to the revisions + checked-out(actions/checkout#1467) + run: |- + git fetch --tags --force + - name: Set up Go uses: actions/setup-go@v4 with: