-
-
Notifications
You must be signed in to change notification settings - Fork 601
Add citation.cff and note for citing in README #4472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
c96fa3f
74c4495
ab20b92
deaee37
30b0952
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Auto-update CITATION.cff | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: write # Required for creating branch and committing updates | ||
pull-requests: write # Required for creating the pull request | ||
|
||
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 | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cff-version: 1.2.0 | ||
message: If you use this software, please cite it using these metadata. | ||
title: ScanCode-Toolkit | ||
authors: | ||
- family-names: Philippe | ||
given-names: Ombredanne | ||
orcid: 'https://orcid.org/0000-0001-5280-9256' | ||
- family-names: Ayan | ||
chinyeungli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
given-names: Sinha Mahapatra | ||
orcid: 'https://orcid.org/0009-0006-0174-5727' | ||
- family-names: Jono | ||
given-names: Yang | ||
- name: 'nexB Inc. and others.' | ||
license: Apache-2.0 | ||
url: 'https://github.com/aboutcode-org/scancode-toolkit' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,9 @@ Other Important Documentation Pages: | |
|
||
See also https://aboutcode.org for related companion projects and tools. | ||
|
||
To cite this repository, visit the main page and click on the 'Cite this | ||
repository' button for APA or BibTeX citation formats. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this button added, will it be there automatically after a release? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you add a CITATION.cff file to the default branch of your repository, a link is automatically added to the repository landing page in the right sidebar, with the label "Cite this repository." |
||
|
||
|
||
Installation | ||
============ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import requests | ||
import os | ||
|
||
CONCEPT_DOI = "10.5281/zenodo.16361290" | ||
ZENODO_API = "https://zenodo.org/api/records" | ||
TOKEN = os.getenv("ZENODO_TOKEN") | ||
|
||
params = { | ||
"q": f"conceptdoi:{CONCEPT_DOI}", | ||
"sort": "version", | ||
"size": 1, | ||
"access_token": TOKEN | ||
} | ||
|
||
r = requests.get(ZENODO_API, params=params) | ||
r.raise_for_status() | ||
latest_record = r.json()["hits"]["hits"][0] | ||
print(latest_record["doi"]) |
Uh oh!
There was an error while loading. Please reload this page.