Skip to content

Commit

Permalink
Create update-csl.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ms609 committed Oct 31, 2024
1 parent 345e1e2 commit 20b96f3
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/update-csl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Update CSL file
on:
schedule:
- cron: '0 0 * * 1' # Runs weekly on Monday at 00:00 UTC
workflow_dispatch: # Allows manual triggering

jobs:
update-csl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Download latest CSL file
run: |
curl -o inst/apa-old-doi-prefix.csl https://raw.githubusercontent.com/citation-style-language/styles/master/apa-old-doi-prefix.csl
- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "No changes to commit"
exit 0
fi
- name: Commit and push if changed
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add inst/apa-old-doi-prefix.csl
git commit -m "Update CSL file from upstream"
git push

0 comments on commit 20b96f3

Please sign in to comment.