Skip to content

Commit bb46bfc

Browse files
committed
Update iga and codemeta2cff
1 parent 2fde1bb commit bb46bfc

File tree

3 files changed

+54
-32
lines changed

3 files changed

+54
-32
lines changed

.github/workflows/codemeta2cff.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CodeMeta2CFF
2+
run-name: Run CodeMeta2CFF after ${{github.event_name}} by ${{github.actor}}
3+
4+
on:
5+
push:
6+
paths: ['codemeta.json']
7+
workflow_dispatch:
8+
inputs:
9+
reason:
10+
description: 'Reason'
11+
required: false
12+
default: 'Manual trigger'
13+
14+
jobs:
15+
CodeMeta2CFF:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Convert CFF
21+
uses: caltechlibrary/codemeta2cff@main
22+
- name: Commit CFF
23+
uses: EndBug/add-and-commit@v9
24+
with:
25+
message: 'Add updated CITATION.cff from codemeta.json file'
26+
add: 'CITATION.cff'

.github/workflows/iga.yaml

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: InvenioRDM GitHub Archiver and CodeMeta2CFF
1+
name: InvenioRDM GitHub Archiver
22
env:
33
INVENIO_SERVER: https://data.caltech.edu
44

@@ -10,47 +10,43 @@ env:
1010
parent_record: "6qhkm-7n074"
1111
debug: false
1212

13-
# ~~~~~~~~~~ The rest of this file should be left as-is ~~~~~~~~~~
13+
# ╭────────────────────────────────────────────╮
14+
# │ The rest of this file should be left as-is │
15+
# ╰────────────────────────────────────────────╯
16+
17+
name: InvenioRDM GitHub Archiver
1418
on:
1519
release:
1620
types: [published]
1721
workflow_dispatch:
1822
inputs:
1923
release_tag:
20-
description: "The tag of the release to archive:"
24+
description: The release tag (empty = latest)
25+
parent_record:
26+
description: ID of parent record (for versioning)
27+
community:
28+
description: Name of InvenioRDM community (if any)
2129
draft:
22-
default: false
23-
description: "Mark the record as a draft:"
30+
description: Mark the record as a draft
31+
type: boolean
2432
all_assets:
25-
default: false
26-
description: "Attach all GitHub assets:"
33+
description: Attach all GitHub assets
34+
type: boolean
2735
all_metadata:
28-
default: false
29-
description: "Include additional GitHub metadata:"
30-
community:
31-
description: "Send record to InvenioRDM community:"
32-
parent_record:
33-
description: "ID of parent record (for versioning):"
36+
description: Include additional GitHub metadata
37+
type: boolean
38+
debug:
39+
description: Print debug info in the GitHub log
40+
type: boolean
41+
42+
run-name: Archive ${{inputs.release_tag || 'latest release'}} in InvenioRDM
3443
jobs:
35-
CodeMeta2CFF:
36-
runs-on: ubuntu-latest
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v4
40-
- name: Convert CFF
41-
uses: caltechlibrary/codemeta2cff@main
42-
- name: Commit CFF
43-
uses: EndBug/add-and-commit@v9
44-
with:
45-
message: 'Add CITATION.cff for release'
46-
add: "['CITATION.cff']"
47-
push: origin HEAD:main
4844
run_iga:
49-
name: "Send to ${{needs.get_repository.outputs.server}}"
45+
name: Send to ${{needs.get_repository.outputs.server}}
5046
runs-on: ubuntu-latest
51-
needs: [get_repository, CodeMeta2CFF]
47+
needs: get_repository
5248
steps:
53-
- uses: caltechlibrary/iga@main
49+
- uses: caltechlibrary/iga@v1
5450
with:
5551
INVENIO_SERVER: ${{env.INVENIO_SERVER}}
5652
INVENIO_TOKEN: ${{secrets.INVENIO_TOKEN}}
@@ -62,10 +58,11 @@ jobs:
6258
parent_record: ${{github.event.inputs.parent_record || env.parent_record}}
6359
release_tag: ${{github.event.inputs.release_tag || 'latest'}}
6460
get_repository:
65-
name: "Get repository name"
61+
name: Get repository name
6662
runs-on: ubuntu-latest
6763
outputs:
6864
server: ${{steps.parse.outputs.host}}
6965
steps:
70-
- id: parse
66+
- name: Extract name from INVENIO_SERVER
67+
id: parse
7168
run: echo "host=$(cut -d'/' -f3 <<< ${{env.INVENIO_SERVER}} | cut -d':' -f1)" >> $GITHUB_OUTPUT

caltechdata_api/get_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def get_metadata(
2727
headers["Authorization"] = "Bearer %s" % token
2828

2929
response = requests.get(url + idv, headers=headers, verify=verify)
30-
print(response.headers)
3130
if response.status_code != 200:
3231
raise Exception(response.text)
3332
else:

0 commit comments

Comments
 (0)