Skip to content

Commit e395bbf

Browse files
committed
Add a GitHub workflow to update the .html files in PRs
This will make it more convenient to update the site: Simply modifying the `.md` files will be enough, and the PR build will do the rest. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 8fa56c5 commit e395bbf

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Diff for: .github/workflows/pr.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Convert Markdown to HTML
2+
on: pull_request
3+
4+
jobs:
5+
md2html: # make sure build/ci work properly
6+
runs-on: ubuntu-latest
7+
permissions:
8+
contents: write
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
repository: ${{ github.event.pull_request.head.repo.full_name }}
13+
ref: ${{ github.event.pull_request.head.ref }}
14+
- run: npm ci
15+
- run: npm run grunt
16+
- name: check if commit & push is needed
17+
id: check
18+
run: |
19+
git add -A \*.html &&
20+
git diff-index --cached --exit-code HEAD -- ||
21+
echo "need-to-commit=yes" >>$GITHUB_OUTPUT
22+
- name: commit & push
23+
if: steps.check.outputs.need-to-commit == 'yes'
24+
run: |
25+
git config user.name "${{github.actor}}" &&
26+
git config user.email "${{github.actor}}@users.noreply.github.com" &&
27+
git commit -m 'Convert Markdown to HTML' -- \*.html &&
28+
git update-index --refresh &&
29+
git diff-files --exit-code &&
30+
git diff-index --cached --exit-code HEAD -- &&
31+
git push
32+

0 commit comments

Comments
 (0)