Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/collect-user-submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ class IssueInfo:
gh_event_path: pydantic.FilePath
submission: Submission = pydantic.Field(default=None)

def __post_init_post_parse__(self):
with open(self.gh_event_path) as f:
self.data = json.load(f)

def create_submission(self):
self._get_inputs()
self._create_submission_input()
return self

def _get_inputs(self):
with open(self.gh_event_path) as f:
self.data = json.load(f)

self.author = self.data['issue']['user']['login']
self.title = self.data['issue']['title']
self.body = self.data['issue']['body']
Expand All @@ -60,8 +61,8 @@ def _create_submission_input(self):
authors.append(
Author(
name=item.get('name', 'anyonymous'),
affiliation=item.get('institution'),
affiliation_url=item.get('institution_url'),
affiliation=item.get('affiliation'),
affiliation_url=item.get('affiliation_url'),
email=item.get('email', ''),
)
)
Expand All @@ -77,6 +78,6 @@ def _create_submission_input(self):

if __name__ == '__main__':
issue = IssueInfo(gh_event_path=os.environ['GITHUB_EVENT_PATH']).create_submission()
inputs = issue.submission.model_dump()
inputs = issue.submission.dict()
with open('resource-gallery-submission-input.json', 'w') as f:
json.dump(inputs, f)
1 change: 0 additions & 1 deletion .github/workflows/update-resource-gallery.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Update Resource Gallery

on:
workflow_dispatch:
issues:
types:
- opened
Expand Down