-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (35 loc) · 1.16 KB
/
generate_readme_from_bib.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
name: Generate README
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository code
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up Python environment
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
# Step 3: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/workflows/requirements.txt
# Step 4: Run the script to generate README.md
- name: Run README generation script
run: python .github/workflows/bib2readme.py
# Step 5: Commit and push changes if README.md was updated
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add --force README.md
git diff-index --quiet HEAD || git commit -m "Update README.md [GH Action]"
git push