debugging 403 error #3
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: Generate Subdirectory List | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: true | |
| ref: main # Make sure to track the actual branch | |
| - name: Generate subdirectories.json | |
| run: | | |
| echo "[" > subdirectories.json | |
| for dir in */ ; do | |
| if [[ "$dir" != "assets/" && "$dir" != ".github/" ]]; then | |
| echo " \"${dir%/}\"," >> subdirectories.json | |
| fi | |
| done | |
| sed -i '$ s/,$//' subdirectories.json | |
| echo "]" >> subdirectories.json | |
| - name: Commit and push | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add subdirectories.json | |
| git commit -m "Update subdirectories list" || echo "No changes" | |
| git push origin main # Explicitly push to the main branch |