Update update-files-manifest.yml #232
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
- name: Generate Files Manifest | |
run: | | |
find . \( -name "metadata.json" -o -path "./otzaria/*" -o -path "./links/*" \) -type f \ | |
! -path "./.git/*" \ | |
! -path "./.github/*" \ | |
! -name "files_manifest.json" \ | |
-exec sh -c 'echo "{\"$(echo {} | cut -c3-)\": {\"hash\": \"$(sha256sum {} | cut -d" " -f1)\"}}"' \; | \ | |
paste -sd "," - | \ | |
(echo "{" && cat && 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 |