download/.github/workflows/checksums.yml
耗子 fd11f1e28d
Some checks failed
Generate Checksums / checksums (push) Has been cancelled
ci: update
2025-02-28 01:45:37 +08:00

35 lines
1.0 KiB
YAML

name: Generate Checksums
on:
push:
branches:
- main
pull_request:
permissions:
contents: write
jobs:
checksums:
runs-on: cn
steps:
- name: Generate checksums
run: |
set -e
rm -rf /tmp/repo || true
git clone --depth 1 ${{ github.server_url }}/${{ github.repository }}.git /tmp/repo
cd /tmp/repo
git checkout ${{ github.ref }}
git lfs install --local
git lfs pull
IFS=$'\n'
for file in $(git ls-files | grep "^panel/" | grep -v ".sha256$" | grep -v ".txt$"); do
filename=$(basename "$file");
sha256sum -b "$file" | sed "s|$file|$filename|" > "${file}.sha256";
done
unset IFS
git add -A
git config --global user.name "CI"
git config --global user.email "ci@haozi.net"
git config --global user.password "${{ secrets.GITHUB_TOKEN }}"
git commit -m "chore: update checksums" || true
git push origin ${{ github.ref }}
rm -rf /tmp/repo