Skip to content
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

Keep communities and grants when exporting to an existing .zenodo.json file #377

Open
bouweandela opened this issue Dec 6, 2023 · 4 comments

Comments

@bouweandela
Copy link

In our project, we use the command cffconvert --infile CITATION.cff --format zenodo --outfile .zenodo.json to export contributors from our citation file to our zenodo file. However, this deletes the "communities" and "grants" entries from our .zenodo.json file (see here for a description) and it has already happened several times that new contributors accidentally deleted those in a pull request because not all reviewers understand how citation files and zenodo interact. Would it be possible to change cffconvert so it keeps those entries when writing to an existing file?

@sdruskat
Copy link
Member

sdruskat commented Jan 9, 2024

Thanks @bouweandela for reporting this. I'll transfer the issue to the relevant cffconvert repository.

@sdruskat sdruskat transferred this issue from citation-file-format/citation-file-format Jan 9, 2024
@jspaaks
Copy link
Member

jspaaks commented Jan 15, 2024

Hi Bouwe,

The way I handle that in my projects is to

  1. have the properties you don't want to overwrite in a file, e.g. .zenodo.extras.json
  2. have cffconvert use the metadata from CITATION.cff to generate the equivalent Zenodo JSON in CI, output in e.g. .zenodo.citation.json
  3. Also in CI, combine them into .zenodo.json with jq before publishing to Zenodo

As follows:

cffconvert --infile CITATION.cff --format zenodo --outfile .zenodo.citation.json
cat .zenodo.citation.json .zenodo.extras.json | jq -s add > .zenodo.json

@bouweandela
Copy link
Author

Thanks for the hint! Do I understand it correctly if I think that that will only work if we set up an extra GitHub action to do the publication to Zenodo? Currently, we use the workflow described here.

@alexlancaster
Copy link

Thanks for the hint! Do I understand it correctly if I think that that will only work if we set up an extra GitHub action to do the publication to Zenodo? Currently, we use the workflow described here.

yes, I think the automatic Github<->Zenodo integration isn't that smart, it just takes the current repo contents and reads the .zenodo.json, I don't think it even looks at CITATION.cff, according to: https://developers.zenodo.org/#github

you could something like the following:

  1. maintain the Zenodo-specific stuff in .zenodo.extras.json as suggested
  2. then set up an GitHut Action that always generates the new .zenodo.json along the lines that @jspaaks suggests upon a change to CITATION.cff.
  3. that way .zenodo.json would always be up-to-date
  4. the do the GitHub release as usual using the integration - it would then use the generated .zenodo.json

The main issues with this is that you have make sure people don't accidentally modify the .zenodo.json directly, and you also can't have the action commit the changes to your branch if it's protected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants