-
Notifications
You must be signed in to change notification settings - Fork 63
44 lines (37 loc) · 1.12 KB
/
update.yaml
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
name: update-html
on:
workflow_dispatch:
pull_request_target:
branches: [main]
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Run build script
id: build
run: |
bash build.sh
if git diff --exit-code --quiet; then
echo "updated=0" >> $GITHUB_OUTPUT
else
echo "updated=1" >> $GITHUB_OUTPUT
fi
- name: Commit and push if changes
if: steps.build.outputs.updated == '1'
run: |
git config --global user.email "[email protected]"
git config --global user.name "acmcsufoss"
git commit -am "Update HTML"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}