Merge branch 'main' of https://github.com/ms609/TreeTools #76
This file contains hidden or 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
| name: Update CSL file | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1' # Runs weekly on Monday at 00:00 UTC | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/update-csl.yml' | |
| jobs: | |
| update-csl: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download latest CSL file | |
| run: | | |
| curl -L -f -o inst/apa-old-doi-prefix.csl https://raw.githubusercontent.com/citation-style-language/styles/master/apa.csl | |
| - name: Validate download | |
| run: | | |
| python3 -c "import xml.etree.ElementTree as ET; ET.parse('inst/apa-old-doi-prefix.csl')" || { echo "Invalid XML detected"; exit 1; } | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if git diff --quiet inst/apa-old-doi-prefix.csl; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| echo "No changes to commit" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| echo "Changes detected" | |
| fi | |
| - name: Commit and push | |
| if: steps.changes.outputs.changed == 'true' | |
| run: | | |
| git config --local user.email "actions@github.com" | |
| 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 |