Skip to content

Commit dda7067

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 dda7067

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Diff for: .github/workflows/pr.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
- run: npm ci
12+
- run: npm run grunt
13+
- name: check if commit & push is needed
14+
id: check
15+
run: |
16+
git add -A \*.html &&
17+
git diff-index --cached --exit-code HEAD -- ||
18+
echo "need-to-commit=yes" >>$GITHUB_OUTPUT
19+
- name: commit & push
20+
if: steps.check.outputs.need-to-commit == 'yes'
21+
run: |
22+
git config user.name "${{github.actor}}" &&
23+
git config user.email "${{github.actor}}@users.noreply.github.com" &&
24+
git commit -m 'Convert Markdown to HTML' -- \*.html &&
25+
git update-index --refresh &&
26+
git diff-files --exit-code &&
27+
git diff-index --cached --exit-code HEAD -- &&
28+
git push
29+

0 commit comments

Comments
 (0)