-
Notifications
You must be signed in to change notification settings - Fork 40
43 lines (43 loc) · 1.69 KB
/
issue_to_bib.yml
File metadata and controls
43 lines (43 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Issue to BibTeX
on:
issues:
types: [labeled]
jobs:
pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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 'COMMENT<<GITHUB_OUTPUT_DELIMITER'
cat comment.out
echo 'GITHUB_OUTPUT_DELIMITER'
} >> "$GITHUB_OUTPUT"
rm -rf comment.out
id: updater
- name: Create Pull Request
if: github.event.label.name == 'food for bibbot'
uses: peter-evans/create-pull-request@v7
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@v7
if: github.event.label.name == 'food for bibbot' && steps.updater.outputs.COMMENT != ''
env:
COMMENT: ${{ steps.updater.outputs.COMMENT }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({...context.repo, issue_number: context.issue.number, body: process.env.COMMENT})