Skip to content

feat: automate readme table #8

feat: automate readme table

feat: automate readme table #8

Workflow file for this run

name: "generate table"
on:
push:
paths:
- "presentations/**"
pull_request:
paths:
- "presentations/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch the full history to allow commit
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Install mdtable
run: go install moul.io/mdtable@latest
- name: Install embedmd
run: go install github.com/campoy/embedmd@latest
- name: Install dependencies
run: go mod download
- name: Build table
run: make build
- name: Configure git for committing
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Check for changes in README.md
id: check_changes
run: |
git diff --quiet README.md || echo "Changes detected" > has_changes.txt
- name: Commit and push changes
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git add README.md
git commit -m "CI: Update README.md with generated table"
git push origin HEAD:${{ github.head_ref }}