Skip to content

Commit 0f8d2e9

Browse files
authored
Merge pull request #1227 from erri120/fix/changelog-action-2
Use b2sum for coreutils 8
2 parents 76e7a2f + 0c28cca commit 0f8d2e9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/validate-changelog-assets.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
paths:
77
- "docs/changelog-assets/**"
88
- ".github/workflows/validate-changelog-assets.yaml"
9+
pull_request:
10+
branches: [ main ]
11+
paths:
12+
- "docs/changelog-assets/**"
13+
- ".github/workflows/validate-changelog-assets.yaml"
914
workflow_dispatch:
1015

1116
jobs:

docs/changelog-assets/README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ Files should be hashed and named after their hash (`{hash}.{ext}`). This has mul
1414

1515
The files in this directory aren't going to be looked up manually. They will be referenced by the CHANGELOG. As such, craming information into the file name is useless and will just lead to weird names and a complete mess.
1616

17-
For hashing, we'll use Blake2b with a length of 128. This hash can be computed using the [`cksum`](https://www.gnu.org/software/coreutils/manual/html_node/cksum-invocation.html#cksum-invocation) coreutils program:
17+
For hashing, we'll use Blake2b with a length of 128. This hash can be computed using the [`cksum`](https://www.gnu.org/software/coreutils/manual/html_node/cksum-invocation.html#cksum-invocation) coreutils program (requires coreutils 9 or greater):
1818

1919
```bash
2020
cksum -a blake2b --untagged --length=128 filename
2121
```
2222

23+
Alternatively, `b2sum` can be used directly for distros that have coreutils 8:
24+
25+
```bash
26+
b2sum --length=128 filename
27+
```
28+
2329
### Images
2430

2531
- Images should be cropped to the contents, don't upload full screenshots.

scripts/changelog-prepare-assets.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ for file in $FILES; do
2626
filename="${filename%.*}"
2727

2828
echo "$file: hashing"
29-
filehash=$(cksum -a blake2b --untagged --length=128 "$file" | awk '{print $1}')
29+
filehash=$(b2sum --length=128 "$file" | awk '{print $1}')
3030

3131
if [[ "$filename" == "$filehash" ]]; then
3232
echo "$file: valid"

0 commit comments

Comments
 (0)