Update action script #99
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: Update README | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'README.md' | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-readme: | |
| if: github.actor != 'github-actions[bot]' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.x" | |
| - name: Debug - List directories | |
| run: | | |
| echo "Listing problem directories in p folder:" | |
| find p -type d -mindepth 1 -maxdepth 1 2>/dev/null | sort || true | |
| echo "Total:" | |
| find p -type d -mindepth 1 -maxdepth 1 2>/dev/null | wc -l || true | |
| - name: Run update script | |
| run: python .github/scripts/update_readme.py | |
| - name: Debug - Show updated README | |
| run: cat README.md | |
| - name: Commit changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add README.md | |
| git commit -m "Update README.md [skip ci]" || echo "No changes to commit" | |
| git push | |
| trigger-pages: | |
| needs: update-readme | |
| if: github.actor != 'github-actions[bot]' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger Pages Deployment | |
| run: | | |
| curl -X POST \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Accept: application/vnd.github.v3+json" \ | |
| https://api.github.com/repos/${{ github.repository }}/pages/builds |