Hey there.
Yesterday I started using GitHub Actions so I’m very new to this.
My first action works very well:
If I commit a .tex file, it builds it into a PDF file and uploads it as an artifact.
name: Build LaTeX PDF files
on:
push:
paths:
- '**.tex'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Read committed files
uses: jitterbit/get-changed-files@v1
id: files
with:
format: space-delimited
- name: Print files
id: print_files
run: |
for changed_file in ${{ steps.files.outputs.all }}; do
echo "Found file: ${changed_file}."
done
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: ${{ steps.files.outputs.all }}
- name: Save PDF file
uses: actions/upload-artifact@v2
with:
name: PDF
path: test.pdf
This only works if the .tex file has the name “test.tex” because the upload-artifact action is hardcoded to use the “test.pdf” file.
Now my question is if there is any way to name files dynamically after the name of the .tex file because I read that substrings aren’t a thing in yml and I want to name the pdf after the tex file.