Merge pull request #179 from JanluOfficial/main #66
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: Consolidate JSON Files | |
on: | |
push: | |
paths: | |
- "snippets/**" | |
permissions: | |
contents: write | |
jobs: | |
consolidate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: | | |
npm install | |
- name: Consolidate Snippets | |
run: | | |
node utils/consolidateSnippets.js # Run the script located in the utils/ folder | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
git add public/consolidated/* | |
git add public/icons/* | |
git diff-index --quiet HEAD || git commit -m "Update consolidated snippets" | |
git push |