Skip to content

Commit a928103

Browse files
committed
Avoid git's internal gzip handling
Since version 2.38 git handles compression with gzip internally which only guarantees reproducible output for the same git and zlib versions. Because of this, the sha256 we generated automatically for the last release is incorrect; ie. it does not match the archive which one can download from Github.
1 parent 84cb0c5 commit a928103

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/workspace_snippet.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -o errexit -o nounset -o pipefail
77
TAG=${GITHUB_REF_NAME}
88
REPO_NAME=${GITHUB_REPOSITORY#*/}
99
PREFIX="${REPO_NAME}-${TAG:1}"
10-
SHA=$(git archive --format=tar.gz --prefix=${PREFIX}/ ${TAG} | shasum -a 256 | awk '{print $1}')
10+
SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}')
1111

1212
cat << EOF
1313
WORKSPACE snippet:

MAINTAINERS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The Git archive checksum can be calculated with:
5959

6060
```bash
6161
REV=0.x
62-
git archive --format=tar.gz --prefix=rules_haskell-${REV}/ v${REV} | sha256sum
62+
git archive --format=tar --prefix=rules_haskell-${REV}/ v${REV} | gzip | sha256sum
6363
```
6464

6565
**Note** The trailing slash on the prefix is important; don't forget it.

0 commit comments

Comments
 (0)