Skip to content

Generate Folder List #5

Generate Folder List

Generate Folder List #5

name: Generate Folder List
on:
schedule:
- cron: '*/5 * * * *' # Runs at every 5th minute
workflow_dispatch: # Allows manual triggering
jobs:
generate-and-commit-folder-list:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Use the Node.js version that matches your project requirements
- name: Install dependencies
run: npm install
- name: Run the script to fetch folders and generate the the JSON file
run: node .scripts/fetchFolders.js
- name: Commit and push changes if there are any
run: |
git config --global user.email "[email protected]"
git config --global user.name "Kkundan"
git add static/folderList.json || echo "folderList.json does not exist, skipping"
git diff --staged --quiet || git commit -m "Automatically update folder list"
git push