-
-
Notifications
You must be signed in to change notification settings - Fork 792
57 lines (48 loc) · 1.79 KB
/
Copy pathupdate-citation.yml
File metadata and controls
57 lines (48 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Auto-update CITATION.cff
on:
release:
types: [published]
jobs:
update-citation:
runs-on: ubuntu-24.04
strategy:
max-parallel: 4
matrix:
python-version: [3.13]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install doi2cff
run:
pip install
git+https://github.com/citation-file-format/doi2cff
- name: Fetch latest Zenodo DOI
id: get-doi # Assign an ID to this step to reference its outputs
env:
ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }}
run: |
ZENODO_DOI=$(python etc/scripts/fetch_latest_doi.py)
echo "ZENODO_DOI=${ZENODO_DOI}" >> "$GITHUB_OUTPUT"
- name: Update CITATION.cff
# Use the output from the 'get-doi' step as the argument for doi2cff
run: doi2cff update ${{ steps.get-doi.outputs.ZENODO_DOI }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: develop
branch: update-citation-${{ github.event.release.tag_name }}
commit-message:
'Automated: Update CITATION.cff with the latest Zenodo DOI'
title: 'Automated: Update CITATION.cff'
body: |
This is an automated pull request to update the `CITATION.cff` file
with the latest Zenodo DOI fetched from Zenodo repository.
# Set to true to automatically merge the PR if all checks pass (optional)
# automerge: true
# Set to true to delete the branch after merging (optional)
# delete-branch: true