generatebib #1071
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: generatebib | |
on: | |
workflow_dispatch: | |
schedule: | |
# UTC min hour day month dayOfWeek | |
- cron: '03 6 * * *' | |
jobs: | |
bib: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install uv | |
python -m uv pip install --system -r requirements.txt | |
- name: Generate bibfile | |
run: | | |
wc -l texmf/bibtex/bib/lsst.bib | |
make lsst.bib | |
wc -l texmf/bibtex/bib/lsst.bib | |
- name: Check diff | |
run: | # set an environment variable | |
if git diff --exit-code; then | |
echo "CHANGED=false" >> ${GITHUB_ENV} | |
echo "No changes - no PR" | |
else | |
echo "CHANGED=true" >> ${GITHUB_ENV} | |
echo "Git changes - should make PR" | |
fi | |
- name: Commit new bib | |
if: env.CHANGED == 'true' | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -m " generated lsst.bib " texmf/bibtex/bib/lsst.bib | |
- name: Create Pull Request | |
id: cpr | |
if: env.CHANGED == 'true' | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.WOM_UPDATEBIB_PAT }} | |
branch: update-bibfile | |
branch-suffix: short-commit-hash | |
title: Automatic bibfile update | |
commit-message: bibfile update | |
body: Update bibfile from lsst.io and etc/static_entries.bib | |
- name: Enable Pull Request Automerge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v3 | |
with: | |
token: ${{ secrets.WOM_UPDATEBIB_PAT }} | |
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | |
merge-method: merge |