Skip to content

Commit b4f426a

Browse files
alexcrichtonabrown
authored andcommitted
Force-fetch tags in CI to fix git describe
My release attempt in #408 did not go well because the release artifacts were not named correctly. This fixes an issue described by actions/checkout#290 where checkouts of annotated tags overwrite the annotation which breaks `git describe`. That means that version detection is broken in CI during releases which causes artifacts to have the wrong information. This applies the workaround described in that issue to `git fetch --tags --force` after the checkout step to undo the overwrite done in the checkout step.
1 parent 5bde500 commit b4f426a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/main.yml

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
- uses: actions/checkout@v4
4646
with:
4747
fetch-depth: 0
48+
- run: git fetch --tags --force
49+
name: Force-fetch tags to work around actions/checkout#290
4850
# We can't use `--depth 1` here sadly because the GNU config
4951
# submodule is not pinned to a particular tag/branch. Please
5052
# bump depth (or even better, the submodule), in case of "error:
@@ -105,6 +107,8 @@ jobs:
105107
- uses: actions/checkout@v4
106108
with:
107109
fetch-depth: 0
110+
- run: git fetch --tags --force
111+
name: Force-fetch tags to work around actions/checkout#290
108112
- run: git submodule update --init --depth 32 --jobs 3
109113
- name: Build
110114
shell: msys2 {0}
@@ -137,6 +141,8 @@ jobs:
137141
- uses: actions/checkout@v4
138142
with:
139143
fetch-depth: 0
144+
- run: git fetch --tags --force
145+
name: Force-fetch tags to work around actions/checkout#290
140146

141147
- run: git submodule update --init --depth 32 --jobs 3
142148

0 commit comments

Comments
 (0)