
Push the a GitHub release to Zenodo via webhook
Source:R/zenodo_webhook_push.R
zenodo_webhook_push.Rdzenodo_webhook_push() provides an interface to the Zenodo REST API to deposit the latest release of your
GitHub repository using the provided webhook token for authentication. This
is especially useful in cases when you need to manually trigger the Zenodo
webhook.
Please note that the function assumes that the GitHub repository is already linked to Zenodo and that a release exists.
I recommend testing this action in the Zenodo Sandbox instance before using it with the main Zenodo platform to avoid unintended data submissions.
Usage
zenodo_webhook_push(
user,
repository,
webhook_token = askpass::askpass("Enter Zenodo webhook token: "),
release_tag = "latest",
sandbox = FALSE
)Arguments
- user
A
characterstring with the GitHub username or organization name of the repository.- repository
A
characterstring with the GitHub repository name.- webhook_token
A
characterstring with the Zenodo webhook token to authenticate the deposit. This token can be found on the repository settings under Webhooks after linking the GitHub repository to Zenodo. If not provided, the function will prompt you to enter it interactively using theaskpassfunction.- release_tag
(optional) A
characterstring with the GitHub release tag to push to Zenodo. If set to"latest"(default), the latest release will be pushed (default:"latest").- sandbox
(optional) A
logicalflag indicating whether to the webhook token is for the Zenodo Sandbox Instance or the main Zenodo platform (default:FALSE).
Value
An invisible NULL. This function is called for
its side effects.
Details
Based on Pieter Huybrechts' script, found here.