-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (42 loc) · 1.32 KB
/
table-gen.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
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 }}