Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/workflows/docker-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

name: Push alganet/shell-versions:all

permissions:
contents: read

on:
push:
branches:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

name: Push alganet/shell-versions:latest

permissions:
contents: read

on:
push:
branches:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: ISC

name: Push alganet/shell-versions:test

permissions:
contents: read

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Checksum Verification
name: Workflow Verification

permissions:
contents: read

on:
pull_request:
Expand All @@ -8,13 +11,32 @@ on:
workflow_dispatch:

jobs:
verify-workflows:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- name: Check workflow permissions
run: |
set -e
missing=0
for f in .github/workflows/*.yml; do
if ! grep -q '^[[:space:]]*permissions:' "$f"; then
echo "Workflow $f missing 'permissions' key"
missing=1
fi
done
if [ "$missing" = 1 ]; then
echo "One or more workflows are missing the 'permissions' stanza."
exit 1
fi

verify-checksums:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3

- name: 'Fast verify: successful download (dash)'
- name: 'Download Verification'
run: |
set -ex
# ensure clean state and perform an initial download (should succeed)
Expand All @@ -25,9 +47,9 @@ jobs:
run: |
set -ex
# backup checksum file
cp checksums/dash/0.5.13.tar.gz.sha256sums checksums/dash/0.5.13.tar.gz.sha256sums.bak
cp checksums/sources/dash/0.5.13.tar.gz.sha256sums checksums/sources/dash/0.5.13.tar.gz.sha256sums.bak
# corrupt checksum: replace hash with ones; keep filename
printf '1111111111111111111111111111111111111111111111111111111111111111 %s\n' "0.5.13.tar.gz" > checksums/dash/0.5.13.tar.gz.sha256sums
printf '1111111111111111111111111111111111111111111111111111111111111111 %s\n' "0.5.13.tar.gz" > checksums/sources/dash/0.5.13.tar.gz.sha256sums
# remove any existing artifact to force re-download
rm -f build/dash/0.5.13.tar.gz
set +e
Expand Down Expand Up @@ -55,6 +77,6 @@ jobs:
- name: 'Restore checksum and verify success'
run: |
set -ex
mv checksums/dash/0.5.13.tar.gz.sha256sums.bak checksums/dash/0.5.13.tar.gz.sha256sums
mv checksums/sources/dash/0.5.13.tar.gz.sha256sums.bak checksums/sources/dash/0.5.13.tar.gz.sha256sums
rm -f build/dash/0.5.13.tar.gz
sh shvr.sh download dash_0.5.13
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,3 @@ This is particularly useful if you want to test a version that we don't bundle
by default, such as an old patch. Our scripts are able to build most
intermediate versions without modifications, but we can't include them all in
any of the default images.

## Checksums and Verification

This repository includes a `checksums/` directory that mirrors the layout in
`build/` and contains `.sha256sums` files for each downloaded artifact. The
build process verifies downloads against these checksums and will fail fast
if checksums are missing or do not match.

To generate checksum files for existing `build/` artifacts, use:

```sh
sh shvr.sh generate_checksums
```

Checksums are used automatically by our `shvr_fetch` helper by default. To
disable verification set `SHVR_SKIP_VERIFY_SHA256=1` (not recommended unless
you need a temporary bypass).
16 changes: 16 additions & 0 deletions checksums/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Checksums and Verification

The `checksums/sources` directory contains `.sha256sums` files for each
downloaded artifact. The build process verifies downloads against these
checksums and will fail fast if checksums are missing or do not match.

To generate checksum files for the sources, use:

```sh
$ sh shvr.sh download $(sh shvr.sh targets)
$ sh shvr.sh generate_checksums
```

Checksums are used automatically by our `shvr_fetch` helper by default. To
disable verification set `SHVR_SKIP_VERIFY_SHA256=1` (not recommended unless
you need a temporary bypass).
Loading
Loading