From f2969e91bda4ca12bf7d44fbf06031543abe9b0e Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 29 Nov 2023 16:24:01 +0100 Subject: [PATCH] Use `fetch-tags` option in release workflows (#1025) ## Changes The manual unshallow step is superfluous and can be done as part of the `actions/checkout` step. Companion to #1022. ## Tests Manual trigger of the snapshot build workflow. --- .github/workflows/release-snapshot.yml | 10 +++++----- .github/workflows/release.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-snapshot.yml b/.github/workflows/release-snapshot.yml index c3398a2bd..51d3ad16b 100644 --- a/.github/workflows/release-snapshot.yml +++ b/.github/workflows/release-snapshot.yml @@ -14,9 +14,9 @@ jobs: steps: - name: Checkout repository and submodules uses: actions/checkout@v4 - - - name: Unshallow - run: git fetch --prune --unshallow + with: + fetch-depth: 0 + fetch-tags: true - name: Setup Go uses: actions/setup-go@v4 @@ -56,7 +56,7 @@ jobs: - name: Update snapshot tag # Snapshot release may only be updated for commits to the main branch. - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' run: | git tag snapshot @@ -65,7 +65,7 @@ jobs: - name: Update snapshot release # Snapshot release may only be updated for commits to the main branch. - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea9e4690c..519dcf43b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,9 @@ jobs: steps: - name: Checkout repository and submodules uses: actions/checkout@v4 - - - name: Unshallow - run: git fetch --prune --unshallow + with: + fetch-depth: 0 + fetch-tags: true - name: Setup Go uses: actions/setup-go@v4