-
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.58 KB
/
latexdiff.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Add new file name with path under `paths` and `file-path`
# Replace every `main` with the branch name (use find and replace all for convenience)
name: Update latexdiff pdf
on:
push:
branches:
- main
paths:
- intro.tex
- example/test.tex
jobs:
latexdiff:
runs-on: ubuntu-latest
strategy:
matrix:
file-path: [intro.tex, example/test.tex]
steps:
- name: latexdiff for ${{ matrix.file-path }}
uses: actions/checkout@v2
with:
fetch-depth: 0
# Install latexdiff
- name: Install latexdiff
run: |
curl -o latexdiff.zip http://ctan.imsc.res.in/support/latexdiff.zip
unzip latexdiff.zip
cd latexdiff
sudo make install
cd ..
sudo apt install texlive-latex-base
# Save second latest commit as old.tex
- name: Save commit into a file
run: |
git log -n 1 --skip 1 --pretty=format:"%H" main ${{ matrix.file-path }} | xargs -I{} git show {}:${{ matrix.file-path }} > old.tex
# Run latexdiff and save it as a pdf
- name: Run latexdiff
run: |
yes "" | latexdiff-vc --pdf old.tex ${{ matrix.file-path }}
# Push the pdf
- name: Push the pdf
continue-on-error: true
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add \*.pdf
git reset latexdiff/*
git commit -m "Update the pdf of ${{ matrix.file-path }}"
git pull
git push