-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (51 loc) · 1.82 KB
/
render_readme.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# .github/workflows/render_readme.yml
name: Render new README based on tally updates
on:
pull_request:
branches:
- main
paths:
- assets/positivity_tally.tsv
- .github/workflows/render_readme.yml
- scripts/splice_readme.py
- DETECTION_RESULTS.tsv
jobs:
render-readme:
name: Render new README
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Dependencies
run: |
pip install uv
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
- name: Generate Markdown Table
run: |
source .venv/bin/activate
python3 scripts/tsv_to_md.py \
assets/positivity_tally.tsv \
> assets/positivity_tally.md
- name: Splice Table into README
run: |
source .venv/bin/activate
python3 scripts/splice_readme.py
- name: Replace previous README
run: |
rm README.md && \
mv new_readme.md README.md
- name: Commit Updated README
if: success()
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email '[email protected]'
git add README.md
git fetch origin proposals
git commit -m "Updated the README file"
git push --force-with-lease origin HEAD:proposals