problem solution & test 0001 #9
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 README | |
| on: | |
| push: | |
| paths: | |
| - 'solutions/*.py' | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| persist-credentials: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements-dev.txt | |
| - name: Generate README | |
| run: python scripts/update_readme.py | |
| - name: Commit and push if changed | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add README.md | |
| if ! git diff --cached --quiet; then | |
| git commit -m "chore: auto-update README with latest solutions" | |
| # Добавляем токен в URL для пуша | |
| git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
| git push | |
| else | |
| echo "No changes to README." | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} |