Skip to content

add PDF files of Shas #245

add PDF files of Shas

add PDF files of Shas #245

name: Update Files Manifest
on:
push:
branches:
- main
- master
workflow_dispatch:
jobs:
update-manifest:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]' && github.actor != 'github-actions'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
fetch-depth: 1
sparse-checkout: |
files_manifest.json
metadata.json
אוצריא/**/*
links/**/*
sparse-checkout-cone-mode: false
- name: Generate Files Manifest
run: |
echo "{" > files_manifest.json
find . \( -path "./metadata.json" -o -path "./אוצריא/*" -o -path "./links/*" \) -type f \
! -path "./.git/*" \
! -path "./.github/*" \
! -name "files_manifest.json" \
-exec sh -c '
path="${1#./}"
hash=$(sha256sum "$1" | cut -d" " -f1)
echo "\"$path\": {\"hash\": \"$hash\"}"
' sh {} \; | sed "$ ! s/$/,/" >> files_manifest.json
echo "}" >> files_manifest.json
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: "files_manifest.json"
message: "Update files manifest"
default_author: github_actions