diff --git a/.github/workflows/addDatesMeta.yml b/.github/workflows/addDatesMeta.yml index ef618e1..178f737 100644 --- a/.github/workflows/addDatesMeta.yml +++ b/.github/workflows/addDatesMeta.yml @@ -14,6 +14,9 @@ jobs: with: fetch-depth: 0 # needed for full meta history + - name: Install jq + run: sudo apt-get update && sudo apt-get install -y jq + - name: Set git config run: | git config --global user.name 'github-actions[bot]' @@ -22,15 +25,34 @@ jobs: - name: Get dates meta run: | - json="{" - dates=$(git ls-tree -r --name-only HEAD | grep -v '/\.' | grep -v '^\.' | while read -r filename; do - date=$(git log -1 --format="%aI" -- "$filename") - printf "\"${filename}\": \"${date}\", " - done) - json+=${dates} - json=${json%, } - json+="}" + # Load existing metadata.json into a variable + if [[ -f "metadata.json" ]]; then + json=$(