Skip to content

Commit

Permalink
ci(github action): add action to convert CITATION.cff to other formats
Browse files Browse the repository at this point in the history
  • Loading branch information
amyheather committed Oct 3, 2024
1 parent 7f4e5b7 commit df8fd33
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/cff_convert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Convert CITATION.cff"
run-name: Convert CITATION.cff to other formats

on:
push:
branches: main
paths: CITATION.cff
workflow_dispatch:

jobs:
convert:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out a copy of the repository
uses: actions/checkout@v4

- name: Convert CITATION.cff to Bibtex
uses: citation-file-format/[email protected]
with:
args: "--infile ./CITATION.cff --format bibtex --outfile citation_bibtex.bib"

- name: Modify Bibtex entry
run: sed -i 's/@misc{YourReferenceHere,/@software{stars_wp3_summary,/' citation_bibtex.bib

- name: Convert CITATION.cff to APA
uses: citation-file-format/[email protected]
with:
args: "--infile ./CITATION.cff --format apalike --outfile citation_apalike.apa"

- name: Commit and push the citation files
run: |
git config --global user.name 'cffconvert GitHub Action'
git config --global user.email '[email protected]'
git add citation_bibtex.bib
git add citation_apalike.apa
git commit --allow-empty -m "chore(citation): auto update .bib and .apa"
git push

0 comments on commit df8fd33

Please sign in to comment.