Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Commit 114c6a2

Browse files
committed
fix: use PR workflow for markdown builds to respect branch protection
Instead of pushing directly to main, the markdown workflow now creates a PR and enables auto-merge. This respects branch protection rules while still automating markdown updates.
1 parent 2088901 commit 114c6a2

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/markdown.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: Build markdown files
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- main
47

58
jobs:
69
markdown-build:
710
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
814
steps:
915
- name: Checkout
1016
uses: actions/checkout@v3
@@ -17,12 +23,18 @@ jobs:
1723
- name: Build
1824
run: go run assembly/main.go
1925

20-
- name: Git commit and push files
26+
- name: Create PR for markdown changes
2127
run: |
2228
if [ -n "$(git status --porcelain)" ]; then
29+
BRANCH="docs/markdown-update-$(date +%s)"
2330
git config --global user.name "GitHub Actions Bot"
2431
git config --global user.email "<>"
32+
git checkout -b "$BRANCH"
2533
git add -A
26-
git commit -m "Markdown build $(date)"
27-
git push -u origin HEAD
34+
git commit -m "docs: update generated markdown"
35+
git push -u origin "$BRANCH"
36+
gh pr create --title "docs: update generated markdown" --body "Auto-generated markdown update" --head "$BRANCH" --base main
37+
gh pr merge --auto --squash
2838
fi
39+
env:
40+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)