Repository navigation
Publish README #1017
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: "Publish README" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "15 0 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Setup python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run script to update README | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
| run: python -m src.main | |
| - name: Commit dashboard outputs | |
| run: | | |
| git config --global user.email "hello@codecrafters.io" | |
| git config --global user.name "codecrafters-bot" | |
| git remote set-url origin https://codecrafters-bot:${{ secrets.GITHUB_TOKEN }}@github.com/codecrafters-io/language-dashboard.git | |
| git pull origin main | |
| git add README.md status.json | |
| git diff --cached --quiet || (git commit -m "ci: auto-update dashboard" && git push) |