You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`DATAVERSE_TOKEN`|**Yes**| This is your personal access token that you can create at your Dataverse instance (see [the Dataverse guide](https://guides.dataverse.org/en/latest/user/account.html#how-to-create-your-api-token)). 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](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository)). |
12
-
|`DATAVERSE_SERVER`|**Yes**| The URL of your Dataverse installation, i.e., [https://dataverse.harvard.edu](https://dataverse.harvard.edu). |
13
-
|`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`. |
14
-
|`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/`). |
15
-
|`DELETE`| No | Can be `True` or `False` (by default `True`) depending on whether all files should be deleted in the dataset on Dataverse before upload. |
16
-
|`PUBLISH`| No | Can be `True` or `False` (by default `True`) depending on whether you'd like to automatically create a new version of the dataset upon upload. If `False`, the uploaded dataset will be a `DRAFT`. |
18
+
|`DATAVERSE_SERVER`|**Yes**| The URL of your Dataverse installation, i.e., [https://dataverse.harvard.edu](https://dataverse.harvard.edu). |
19
+
|`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`. |
20
+
|`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/`). |
21
+
|`DELETE`| No | Can be `True` or `False` (by default `True`) depending on whether all files should be deleted in the dataset on Dataverse before upload. |
22
+
|`PUBLISH`| No | Can be `True` or `False` (by default `False`) depending on whether you'd like to automatically create a new version of the dataset upon upload. If `False`, the uploaded dataset will be a `DRAFT`.|
17
23
18
24
## Usage
19
25
20
-
To use the action, create a new YML file (i.e., `workflow.yml`) in the directory `.github/workflows/` in your GitHub repository.
26
+
To use the action, create a new YML file (i.e., `workflow.yml`) and place it in the directory `.github/workflows/` in your GitHub repository.
21
27
22
28
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.
23
29
@@ -33,64 +39,71 @@ jobs:
33
39
runs-on: ubuntu-latest
34
40
steps:
35
41
- name: Send repo to Dataverse
36
-
uses: IQSS/dataverse-uploader@v1.1
42
+
uses: IQSS/dataverse-uploader@v1.2
37
43
with:
38
44
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
39
45
DATAVERSE_SERVER: https://demo.dataverse.org
40
46
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
41
47
```
42
48
43
-
If you'd like to upload files from a specific subdirectory only, you should add the `GITHUB_DIR` argument in your workflow.
49
+
If you'd like to upload files from a specific subdirectory only (for instance, a `data` folder),
50
+
you should add the `GITHUB_DIR` argument in your workflow, as follows:
44
51
45
52
```
46
-
jobs:
47
-
build:
48
-
runs-on: ubuntu-latest
49
-
steps:
50
-
- name: Send repo to Dataverse
51
-
uses: IQSS/dataverse-uploader@v1.1
52
-
with:
53
-
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
54
-
DATAVERSE_SERVER: https://demo.dataverse.org
55
-
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
56
-
GITHUB_DIR: data
53
+
steps:
54
+
- name: Send repo to Dataverse
55
+
uses: IQSS/dataverse-uploader@v1.2
56
+
with:
57
+
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
58
+
DATAVERSE_SERVER: https://demo.dataverse.org
59
+
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
60
+
GITHUB_DIR: data
57
61
```
58
62
59
-
If you wouldn't want the action to delete your dataset before upload (i.e., if you already have a Dataverse `DRAFT` dataset), set the `DELETE` argument to `False` like:
63
+
By default, the action will sync the GitHub repository and the Dataverse dataset, meaning that it will
64
+
delete the Dataverse content before uploading the content from GitHub. If you don't want the action to
65
+
delete your dataset before upload (i.e., if you already have a Dataverse `DRAFT` dataset),
66
+
set the `DELETE` argument to `False` like:
60
67
61
68
```
62
-
jobs:
63
-
build:
64
-
runs-on: ubuntu-latest
65
-
steps:
66
-
- name: Send repo to Dataverse
67
-
uses: IQSS/dataverse-uploader@v1.1
68
-
with:
69
-
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
70
-
DATAVERSE_SERVER: https://demo.dataverse.org
71
-
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
72
-
GITHUB_DIR: data
73
-
DELETE: False
69
+
steps:
70
+
- name: Send repo to Dataverse
71
+
uses: IQSS/dataverse-uploader@v1.2
72
+
with:
73
+
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
74
+
DATAVERSE_SERVER: https://demo.dataverse.org
75
+
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
76
+
GITHUB_DIR: data
77
+
DELETE: False
74
78
```
75
79
76
-
Upon upload, the action will automatically publish a new version of the Dataverse dataset by default. If you'd like to create a new version manually, set the `PUBLISH` argument to `False`.
80
+
The action automatically uploads new content to a Dataverse dataset, but it will not publish it as a
81
+
new version by default. If you'd like the action to publish a new dataset version in Dataverse,
82
+
set the `PUBLISH` argument to `True`.
77
83
78
84
```
79
-
jobs:
80
-
build:
81
-
runs-on: ubuntu-latest
82
-
steps:
83
-
- name: Send repo to Dataverse
84
-
uses: IQSS/dataverse-uploader@v1.1
85
-
with:
86
-
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
87
-
DATAVERSE_SERVER: https://demo.dataverse.org
88
-
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
89
-
GITHUB_DIR: data
90
-
DELETE: False
91
-
PUBLISH: False
85
+
steps:
86
+
- name: Send repo to Dataverse
87
+
uses: IQSS/dataverse-uploader@v1.2
88
+
with:
89
+
DATAVERSE_TOKEN: ${{secrets.DATAVERSE_TOKEN}}
90
+
DATAVERSE_SERVER: https://demo.dataverse.org
91
+
DATAVERSE_DATASET_DOI: doi:10.70122/FK2/LVUA
92
+
GITHUB_DIR: data
93
+
DELETE: False
94
+
PUBLISH: True
92
95
```
93
96
97
+
## Q&A
98
+
99
+
> If you change the content of your GitHub repository, are the changes synchronized in Dataverse?
100
+
> Otherwise, is it possible to synchronize them automatically?
101
+
102
+
Yes, the action is able to automatically update the Dataverse dataset. In other words, if the action
103
+
is triggered with every `push` to the GitHub repository, it will automatically upload its content to
104
+
Dataverse. You specify the action triggers in the workflow (`.yml`) file, and in this case, it would
105
+
contain `on: push` line to execute the action on every push to the repository.
106
+
94
107
## Related projects
95
108
96
109
Check out the following related projects:
@@ -105,6 +118,10 @@ Visit [this page](https://atrisovic.github.io/dataverse-badge/) to create a Data
105
118
106
119
Looking for a stand-alone Dataverse uploader that will work from the command line? Check out [DVUploader](https://github.com/GlobalDataverseCommunityConsortium/dataverse-uploader).
107
120
121
+
## References
122
+
123
+
See the official Dataverse documentation [here](https://guides.dataverse.org/en/latest/admin/integrations.html#id10).
124
+
108
125
## Contact
109
126
110
127
Don't hesitate to create an issue, a pull request, or contact us if you notice any problems with the action.
0 commit comments