From 7398bf7f937a7f3a10b580b053b31bb95a7b6104 Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Wed, 26 Aug 2026 09:14:59 -0500 Subject: [PATCH] fix: fetch-tags when checking out repo in gh actions I suspect a bump to the github action checkout may have changed whether git tags are pulled by default on checkout. Currently github checkout workflow passes "--no-tags" to git and the resulting repository checkout has no tags. This normally isn't an issue as it only shows up when we build a tagged release where the stacker VERSION value changes if a tag is present. The v1.2.1 tag is such a case. Looking at the PR run for this commit shows that we do check out tags which should resolve the issue for the next tagged release. Signed-off-by: Ryan Harper --- .github/workflows/build.yaml | 2 ++ .github/workflows/cloc.yml | 2 ++ .github/workflows/codeql-analysis.yml | 2 ++ .github/workflows/commit-msg.yaml | 2 ++ .github/workflows/coverage.yaml | 2 ++ .github/workflows/dco.yml | 2 ++ .github/workflows/release.yaml | 2 ++ 7 files changed, 14 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 29dcfe26..d7807a7c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,6 +55,8 @@ jobs: name: "Build platform ${{ matrix.platform }} golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}" steps: - uses: actions/checkout@v7 + with: + fetch-tags: true - name: Clean disk space uses: ./.github/actions/clean-runner - uses: benjlevesque/short-sha@v4.0 diff --git a/.github/workflows/cloc.yml b/.github/workflows/cloc.yml index 5786f210..d23d2385 100644 --- a/.github/workflows/cloc.yml +++ b/.github/workflows/cloc.yml @@ -23,6 +23,8 @@ jobs: go-version: 1.25.12 - name: Check out source code uses: actions/checkout@v7 + with: + fetch-tags: true - name: Install dependencies run: | cd $GITHUB_WORKSPACE diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0bf728df..32133d14 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,6 +44,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v7 + with: + fetch-tags: true - name: Install go uses: actions/setup-go@v6 diff --git a/.github/workflows/commit-msg.yaml b/.github/workflows/commit-msg.yaml index 3cc5ba30..cf024464 100644 --- a/.github/workflows/commit-msg.yaml +++ b/.github/workflows/commit-msg.yaml @@ -17,6 +17,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 + with: + fetch-tags: true - name: Check Commit Type uses: gsactions/commit-message-checker@v2 with: diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index be7dfa12..0f5da115 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -51,6 +51,8 @@ jobs: name: "golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}" steps: - uses: actions/checkout@v7 + with: + fetch-tags: true - name: Clean disk space uses: ./.github/actions/clean-runner - uses: benjlevesque/short-sha@v4.0 diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml index dd515645..f2e6cfc3 100644 --- a/.github/workflows/dco.yml +++ b/.github/workflows/dco.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 + with: + fetch-tags: true - name: Set up Python 3.x uses: actions/setup-python@v6 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index edecaf27..c4cb8e75 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,8 @@ jobs: build-id: ${{steps.build-id.outputs.build-id}} steps: - uses: actions/checkout@v7 + with: + fetch-tags: true - uses: benjlevesque/short-sha@v4.0 id: short-sha - id: build-id