Skip to content

write permissions

write permissions #40

Workflow file for this run

name: Build LaTeX document
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
permissions:
contents: read
pull-requests: read
jobs:
build_latex:
runs-on: ubuntu-latest
if: |
(github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
permissions:
contents: read
pull-requests: write
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
root_file: main.tex
pre_compile: cd mug_document_src
latexmk_use_lualatex: true
- name: Commit and push PDF
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add mug_document_src/main.pdf
git commit -m "Update MUG PDF" || echo "No changes to commit"
git push origin HEAD:${{ github.head_ref || github.ref_name }}
#- name: Upload PDF file
# uses: actions/upload-artifact@v4
# with:
# name: PDF
# path: mug_document_src/main.pdf