From 850c1f09556641e0352ec529e956bfda377905c7 Mon Sep 17 00:00:00 2001 From: Alex Chernyakhovsky Date: Wed, 3 Aug 2022 21:12:32 -0400 Subject: [PATCH] Fetch forcibly while fetching tags `git fetch --tags --unshallow`, run as part of the CI for `git describe` to do the right thing, ran into the error: ``` ! [rejected] mosh-1.4.0-rc0 -> mosh-1.4.0-rc0 (would clobber existing tag) ``` This is because mosh uses annotated tags, whereas the initial fetch command run by actions/checkout@v2 ends up creating an *unannotated* tag of the same name. This means that any time the release CI runs, it would fail. The resolution is straightforward: --force so that the line becomes ``` t [tag update] mosh-1.4.0-rc0 -> mosh-1.4.0-rc0 ``` and the annotation is brought in. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67a4413..1fac161 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,7 +110,7 @@ jobs: - name: "unshallow git repository for git describe" if: ${{ startsWith(matrix.os, 'macos') }} - run: git fetch --tags --unshallow + run: git fetch --tags --unshallow -f - name: "macOS package build" if: ${{ startsWith(matrix.os, 'macos') }}