-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (34 loc) · 1.04 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
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-test.git
git diff --quiet || (git add README.md && git commit -m "ci: auto-update README" && git push)