Skip to content

Commit

Permalink
Merge pull request #1227 from erri120/fix/changelog-action-2
Browse files Browse the repository at this point in the history
Use b2sum for coreutils 8
  • Loading branch information
erri120 authored Apr 17, 2024
2 parents 76e7a2f + 0c28cca commit 0f8d2e9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/validate-changelog-assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
paths:
- "docs/changelog-assets/**"
- ".github/workflows/validate-changelog-assets.yaml"
pull_request:
branches: [ main ]
paths:
- "docs/changelog-assets/**"
- ".github/workflows/validate-changelog-assets.yaml"
workflow_dispatch:

jobs:
Expand Down
8 changes: 7 additions & 1 deletion docs/changelog-assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ Files should be hashed and named after their hash (`{hash}.{ext}`). This has mul

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.

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:
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):

```bash
cksum -a blake2b --untagged --length=128 filename
```

Alternatively, `b2sum` can be used directly for distros that have coreutils 8:

```bash
b2sum --length=128 filename
```

### Images

- Images should be cropped to the contents, don't upload full screenshots.
Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog-prepare-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for file in $FILES; do
filename="${filename%.*}"

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

if [[ "$filename" == "$filehash" ]]; then
echo "$file: valid"
Expand Down

0 comments on commit 0f8d2e9

Please sign in to comment.