Demonstration for JabRef's GitHub action.
name: Check
on:
pull_request:
jobs:
test-action:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Run jabref-action
uses: jabref/jabref-action@main
with:
bibfile: Chocolate.bib
output-format: github-actionsWith output-format: github-actions, the consistency findings are emitted as
GitHub Actions workflow commands,
so they appear as annotations on the pull request and the commit. The raw output looks like:
::error file=Chocolate.bib,line=33,col=1,title=Richard_2017:groups::unknown field for entry type Article
::error file=Chocolate.bib,line=42,col=1,title=Parker_2006:groups::unknown field for entry type Article
...
The default output-format is errorformat. Other supported values are csv, github-actions and txt. The txt format is actually Markdown — it produces a table, so it renders nicely in the GitHub Actions job summary.
The check-collection.yml workflow runs the action against every .bib and .bb file in the JabRef/bibtex-library-collection repository, which is included here as a git submodule.
The submodule tracks the collection's flattened mirror branch (shallow clone), so all bibliography files are available without nested submodules:
[submodule "bibtex-library-collection"]
path = bibtex-library-collection
url = https://github.com/JabRef/bibtex-library-collection.git
branch = mirror
shallow = trueThe workflow uses two jobs:
discover— lists every.biband.bbfile in the submodule and emits them as a JSON array used to build the matrix.check— consumes the matrix and runsjabref-actiononce per file. It usesmax-parallel: 1so the files are checked sequentially, andfail-fast: falseso one file with inconsistencies does not cancel the rest. It setsoutput-format: txt, so each file's findings render as a Markdown table in the job summary.
Note
A GitHub Actions matrix is limited to 256 jobs. If the collection ever contains more than 256 .bib/.bb files, the matrix has to be split (e.g. batched into multiple jobs).