Skip to content

Instantly share code, notes, and snippets.

@seignovert
Created February 21, 2019 20:02
Show Gist options
  • Save seignovert/ae6771f400ca464d294261f42900823a to your computer and use it in GitHub Desktop.
Save seignovert/ae6771f400ca464d294261f42900823a to your computer and use it in GitHub Desktop.
Setup Zenodo DOI badge before the first release

Setup Zenodo DOI badge before the first release

Zenodo doi badge

Before submitting your first release, identify your Github repo id on Github API at:

https://api.github.com/repos/{user}/{repo}

Then add the following badge to your README.md:

[![DOI](https://zenodo.org/badge/{github_id}.svg)](https://zenodo.org/badge/latestdoi/{github_id})

or to your README.rst:

|DOI|

.. |DOI| image:: https://zenodo.org/badge/{github_id}.svg
        :target: https://zenodo.org/badge/latestdoi/{github_id}

Then, submit your first release

Notes:

  • The DOI badge will not be issued until you make you first release but will be included in your release.
  • See Github documentation to setup Zenodo webhooks.
@sorenwacker
Copy link

sorenwacker commented Jul 29, 2024

Is this still up to date?

The zenodo website provides a different link:

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13121149.svg)](https://doi.org/10.5281/zenodo.13121149)

DOI

@odarbelaeze
Copy link

Tried today and it worked!

@seignovert
Copy link
Author

Is this still up to date?

The zenodo website provides a different link:

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13121149.svg)](https://doi.org/10.5281/zenodo.13121149)

DOI

@sorenwacker : yes it still works.

In your case https://api.github.com/repos/LewisResearchGroup/ms-mint-app give you an id of 491654035. Therefore your Zenodo latest DOI link is https://zenodo.org/badge/latestdoi/491654035 which will always redirect to your latest released version, currently 10.5281/zenodo.13134073 for your version 1.0.1.

Same goes for the badge, its link is https://zenodo.org/badge/491654035.svg but will show the latest released record:

[![DOI](https://zenodo.org/badge/491654035.svg)](https://zenodo.org/badge/latestdoi/491654035)

DOI

Important

The Zenodo DOI snippet in Zenodo details section of the landing page shows you how to cite the current release but will not be dynamically updated contrary to the latest DOI link/badge above which can be put in a README file once and for all (and even before the first release).

Warning

The Zenodo Concept DOI (in your case 10.5281/zenodo.13121148) is created upon the first release (which was 10.5281/zenodo.13121149 for your version 1.0.0) but can not be guessed in advance (contrary to the latest DOI link). It will never change so it is not appropriate to cite the version used in a study.

Caution

Even if it is named latestdoi this URL endpoint is just a redirection, not an actual DOI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment