Skip to content

Trigger workflow for testing #1

Trigger workflow for testing

Trigger workflow for testing #1

name: Consolidate JSON Files
on:
push:
paths:
- "public/data/**"
permissions:
contents: write
jobs:
consolidate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Consolidate JSON files
run: |
mkdir -p consolidated
echo "[" > consolidated/all_snippets.json
find data -name "*.json" -exec sh -c 'jq -c ".[]" {} | sed "s/^/{\"language\": \"$(basename {} .json)\", /" | sed "s/}/},/" >> consolidated/all_snippets.json' \;
sed -i '$ s/,$//' consolidated/all_snippets.json
echo "]" >> consolidated/all_snippets.json
- name: Commit and push changes
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git add consolidated/all_snippets.json
git commit -m "Update consolidated snippets"
git push