-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
starters: auto-import publications from Bibtex
- Loading branch information
Showing
51 changed files
with
603 additions
and
1,398 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
starters/academic/.github/workflows/import-publications.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Wowchemy GitHub Action to convert Bibtex publications to Markdown-based webpages | ||
name: Import Publications From Bibtex | ||
|
||
# Require permission to create a PR | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
# Run workflow when a `.bib` file is added or updated in the `data/` folder | ||
on: | ||
push: | ||
branches: ['main'] | ||
paths: ['publications.bib'] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
wowchemy: | ||
if: github.repository_owner != 'wowchemy' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install academic==0.10.0 | ||
- name: Run Academic (Bibtex To Markdown Converter) | ||
# Check `.bib` file exists for case when action runs on `.bib` deletion | ||
# Note GH only provides hashFiles func in `steps.if` context, not `jobs.if` context | ||
if: ${{ hashFiles('publications.bib') != '' }} | ||
run: academic import publications.bib content/publication/ --compact | ||
- name: Create Pull Request | ||
# Set ID for `Check outputs` stage | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit-message: 'content: import publications from Bibtex' | ||
title: Wowchemy - Import latest publications | ||
body: | | ||
Import the latest publications from `publications.bib` to `content/publication/`. | ||
将最新的出版物从`publications.bib`导入到`content/publication/`。 | ||
[View Documentation](https://github.com/wowchemy/bibtex-to-markdown) | ||
base: main | ||
labels: automated-pr, content | ||
branch: wowchemy-import-publications | ||
delete-branch: true | ||
- name: Check outputs | ||
if: ${{ steps.cpr.outputs.pull-request-number }} | ||
run: | | ||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | ||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.