-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(github action): add action to convert CITATION.cff to other formats
- Loading branch information
1 parent
7f4e5b7
commit df8fd33
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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,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 |