GitHub Action
Dataverse Uploader Action
This action uploads the repository content to a Dataverse dataset.
To use this action, you will need the following input parameters:
Parameter | Required | Description |
---|---|---|
DATAVERSE_TOKEN |
Yes | This is your personal access token that you can create at your Dataverse instance (see the Dataverse guide). Save your token as a secret variable called DATAVERSE_TOKEN in your GitHub repository that you want to upload to Dataverse (see the GitHub guide). |
DATAVERSE_SERVER |
Yes | The URL of your Dataverse installation, i.e., https://dataverse.harvard.edu. |
DATAVERSE_DATASET_DOI |
Yes | This action requires that a dataset (with a DOI) exists on the Dataverse server. Make sure to specify your DOI in this format: doi:<doi> , i.e., doi:10.70122/FK2/LVUA . |
GITHUB_DIR |
No | Use GITHUB_DIR if you would like to upload files from only a specific subdirectory in your GitHub repository (i.e., just data/ ). |
To use the action, create a new YML file (i.e., workflow.yml
) in the directory .github/workflows/
in your GitHub repository.
The action workflow can be executed at trigger events such as push
and release
. If you'd only like to run the workflow manually from the Actions tab, use the workflow_dispatch
event option.
Here is an example of a workflow.yml
that actives the action on release
and manually.
on:
release:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Send repo to Dataverse
uses: atrisovic/dataverse-uploader@master
with:
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
DATAVERSE_SERVER: https://demo.dataverse.org
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
If you'd like to upload files from a specific subdirectory only, you should add the GITHUB_DIR
argument in your action.
on:
release:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Send repo to Dataverse
uses: atrisovic/dataverse-uploader@master
with:
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
DATAVERSE_SERVER: https://demo.dataverse.org
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
GITHUB_DIR: data
Check out the following related projects:
Visit this page to create a Dataverse DOI Badge for your GitHub repository.
Looking for a stand-alone Dataverse uploader that will work from the command line? Check out DVUploader.
Don't hesitate to create an issue, a pull request, or contact us if you notice any problems with the action.