-
-
Notifications
You must be signed in to change notification settings - Fork 600
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 3 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,46 @@ | ||
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 | ||
env: | ||
ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }} | ||
run: | | ||
python etc/scripts/fetch_latest_doi.py > latest_doi.txt | ||
echo "Latest DOI: $(cat latest_doi.txt)" | ||
|
||
- name: Update CITATION.cff | ||
run: doi2cff update $(cat latest_doi.txt) | ||
|
||
- name: Commit updated CITATION.cff | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git add CITATION.cff | ||
git commit -m "Update CITATION.cff with latest Zenodo DOI" | ||
git push origin HEAD:develop | ||
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.