-
Notifications
You must be signed in to change notification settings - Fork 14
32 lines (30 loc) · 1.06 KB
/
pr.yml
File metadata and controls
32 lines (30 loc) · 1.06 KB
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
name: Convert Markdown to HTML
on: pull_request
jobs:
md2html: # make sure build/ci work properly
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- run: npm ci
- run: npm run grunt
- name: check if commit & push is needed
id: check
run: |
git add -A \*.html &&
git diff-index --cached --exit-code HEAD -- ||
echo "need-to-commit=yes" >>$GITHUB_OUTPUT
- name: commit & push
if: steps.check.outputs.need-to-commit == 'yes'
run: |
git config user.name "${{github.actor}}" &&
git config user.email "${{github.actor}}@users.noreply.github.com" &&
git commit -m 'Convert Markdown to HTML' -- \*.html &&
git update-index --refresh &&
git diff-files --exit-code &&
git diff-index --cached --exit-code HEAD -- &&
git push