bitmeet #5
This file contains hidden or 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: Auto Update File Index | |
| on: | |
| push: | |
| paths: | |
| - 'public/1/**' | |
| branches: | |
| - main | |
| jobs: | |
| update-index: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Generate File Index | |
| run: | | |
| node scripts/generate-file-index.js | |
| - name: Commit and Push changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add src/data/file-index.json public/_redirects | |
| if git diff --staged --quiet; then | |
| echo "No changes in file index. Skipping commit." | |
| else | |
| git commit -m "[SYSTEM] Update file index and redirects [skip ci]" | |
| git push | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |