New Papers for bibbot! #365
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: Issue to BibTeX | |
on: | |
issues: | |
types: [labeled] | |
jobs: | |
pull_request: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Parse issue and update bibtex file | |
if: github.event.label.name == 'food for bibbot' | |
run: | | |
cd bin | |
python3 -m pip install --user --upgrade pip | |
python3 -m pip install --user setuptools | |
python3 -m pip install --user bibtexparser arxivcheck | |
python3 issue_to_bibtex.py -b "${{ github.event.issue.body }}" > comment.out 2>&1 | |
echo "::set-output name=COMMENT::$(cat comment.out)" | |
rm -rf comment.out | |
id: updater | |
- name: Create Pull Request | |
if: github.event.label.name == 'food for bibbot' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: updated pint.bib using bibbot | |
title: pint.bib updates | |
body: 'This is an auto-generated PR with reference updates. This closes #${{ github.event.issue.number }}.' | |
branch: bibtex-bibbot-${{ github.event.issue.number }} | |
branch-suffix: short-commit-hash | |
- name: Add comment to issue | |
uses: actions/github-script@0.3.0 | |
if: github.event.label.name == 'food for bibbot' && steps.updater.outputs.COMMENT != '' | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.issues.createComment({...context.issue, body: '${{ steps.updater.outputs.COMMENT }}'}) |