Publish README #233
This file contains 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 * * *' | |
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: Update README.md | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Ryan Gang" | |
git remote set-url origin https://ryan-gang:${{ secrets.GITHUB_TOKEN }}@github.com/codecrafters-io/language-dashboard.git | |
git diff --quiet || (git add README.md && git commit -m "ci: auto-update README" && git push) |