Automate README generation with GitHub Actions
- Add `generate-readme.yml` workflow to update `README.md` on pushes to `main` when `_README.md` changes - Introduce AWK scripts as a submodule (`scripts/awk`) for processing the README - Rename `README.md` to `_README.md` to serve as the source file
This commit is contained in:
parent
0d85dc34cc
commit
b17c5ff981
|
|
@ -0,0 +1,34 @@
|
||||||
|
name: Update README
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '_README.md'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-readme:
|
||||||
|
if: ${{ github.actor != 'github-actions[bot]' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y gawk
|
||||||
|
|
||||||
|
- name: Generate README.md
|
||||||
|
run: |
|
||||||
|
awk -f scripts/awk/addGithubShields.awk _README.md | awk -f scripts/awk/makeShieldsSquare.awk > README.md
|
||||||
|
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: 'Auto-update README.md [skip ci]'
|
||||||
|
file_pattern: README.md
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
[submodule "scripts/awk"]
|
||||||
|
path = scripts/awk
|
||||||
|
url = https://github.com/she3o/AWKward
|
||||||
|
branch = for-awesome-zotero
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 9546dc0876ae7ac402395bdcfdd9dd9f5f521ae1
|
||||||
Loading…
Reference in New Issue