From e4b348c183802e0e74381934bd2ff099cf431b5c Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sun, 13 Oct 2024 19:20:50 -0400 Subject: [PATCH] ci: make sure checkouts fetch tags --- .github/workflows/ci.yml | 38 +++++++++++++++++------ .github/workflows/codeql-analysis.yml | 9 ++++-- .github/workflows/sonarcloud-analysis.yml | 8 +++-- .github/workflows/valgrind-analysis.yml | 9 ++++-- 4 files changed, 48 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d3321ae2..11aeac056 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,9 +140,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Get version - uses: ./.github/actions/get-version + # the fetch-tags option for checkout does not work correctly so we need todo this + - name: Fetch tags + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git fetch --tags --force - name: Cache vcpkg dir uses: actions/cache@v4 @@ -232,9 +237,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Get version - uses: ./.github/actions/get-version + # the fetch-tags option for checkout does not work correctly so we need todo this + - name: Fetch tags + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git fetch --tags --force - name: Cache deps dir uses: actions/cache@v4 @@ -307,12 +317,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Get version - uses: ./.github/actions/get-version - - - name: Config Git safe dir - run: git config --global --add safe.directory $GITHUB_WORKSPACE + # the fetch-tags option for checkout does not work correctly so we need todo this + - name: Fetch tags + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git fetch --tags --force - name: Install dependencies run: ./scripts/install_deps.py ${{ matrix.distro.extra-dep-args }} @@ -370,6 +382,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # the fetch-tags option for checkout does not work correctly so we need todo this + - name: Fetch tags + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git fetch --tags --force - name: Build on FreeBSD if: ${{ matrix.distro.name == 'freebsd' }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3660969a3..03bad7dc8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -21,9 +21,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Config Git safe dir - run: git config --global --add safe.directory $GITHUB_WORKSPACE + # the fetch-tags option for checkout does not work correctly so we need todo this + - name: Fetch tags + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git fetch --tags --force - name: Install dependencies run: ./scripts/install_deps.py diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index a861d6588..bbda746a9 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -25,11 +25,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - # Fetch all history for SonarScanner blame data fetch-depth: 0 - - name: Config Git safe dir - run: git config --global --add safe.directory $GITHUB_WORKSPACE + # the fetch-tags option for checkout does not work correctly so we need todo this + - name: Fetch tags + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git fetch --tags --force - name: Install dependencies run: | diff --git a/.github/workflows/valgrind-analysis.yml b/.github/workflows/valgrind-analysis.yml index dcfa05621..443531d08 100644 --- a/.github/workflows/valgrind-analysis.yml +++ b/.github/workflows/valgrind-analysis.yml @@ -13,9 +13,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Config Git safe dir - run: git config --global --add safe.directory $GITHUB_WORKSPACE + # the fetch-tags option for checkout does not work correctly so we need todo this + - name: Fetch tags + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git fetch --tags --force - name: Install dependencies run: |