-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 1.66 KB
/
Copy pathdraft-pdf.yml
File metadata and controls
54 lines (51 loc) · 1.66 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Draft PDF
# Builds paper.md into a JOSS-formatted PDF (Pandoc + inara, via the official
# openjournals action). Not a JOSS submission step -- this just keeps the
# committed paper.pdf in the repo root in sync with paper.md/paper.bib for
# local review. On a direct push it commits the rebuilt PDF back (skipped for
# pull_request runs, since a PR checkout is a detached merge ref, not the head
# branch, so pushing there would go to the wrong place or fail outright).
on:
push:
paths:
- paper.md
- paper.bib
- .github/workflows/draft-pdf.yml
pull_request:
paths:
- paper.md
- paper.bib
- .github/workflows/draft-pdf.yml
workflow_dispatch:
permissions:
contents: write
jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
paper-path: paper.md
- name: Upload PDF artifact
uses: actions/upload-artifact@v4
with:
name: paper
# The action writes the compiled PDF next to the paper source.
path: paper.pdf
- name: Commit and push rebuilt PDF
if: github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add paper.pdf
if ! git diff --cached --quiet; then
git commit -m "Rebuild paper.pdf [skip ci]"
git push
else
echo "paper.pdf unchanged, nothing to commit"
fi