This commit is contained in:
Ubuntu 2026-03-02 10:29:45 +00:00
commit 23665d7015
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,41 @@
name: Hash all .txt files
on:
push:
branches:
- main
jobs:
txt_hashes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compute SHA-256 hashes for all .txt files
shell: bash
run: |
set -euo pipefail
# Find all .txt files, sort deterministically, hash each, and output "hash path"
# Then hash the manifest itself so you can compare runs easily.
manifest="txt_sha256_manifest.txt"
find . -type f -name '*.txt' -print0 \
| LC_ALL=C sort -z \
| xargs -0 sha256sum \
| sed 's|^\([0-9a-f]\+\) \./|\1 |' \
> "${manifest}"
echo "---- Manifest (${manifest}) ----"
cat "${manifest}"
echo "---- Manifest SHA-256 ----"
sha256sum "${manifest}"
# Optional: keep the manifest as a downloadable artifact (if your Gitea Actions setup supports artifacts)
# - name: Upload manifest artifact
# uses: actions/upload-artifact@v4
# with:
# name: txt-sha256-manifest
# path: txt_sha256_manifest.txt

0
a.txt Normal file
View File

1
b.txt Normal file
View File

@ -0,0 +1 @@
a