Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update update-resource-gallery.yaml #392

Merged
merged 3 commits into from
Jan 18, 2024
Merged
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
18 changes: 6 additions & 12 deletions .github/workflows/update-resource-gallery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types:
- opened
- edited

jobs:
validate-user-submission:
if: |
Expand Down Expand Up @@ -87,21 +88,14 @@ jobs:
- name: Update resource gallery
shell: python
run: |
import yaml
import json
from ruamel.yaml import YAML

yaml = YAML()
submission_file = 'resource-gallery-submission-input.json'
resource_gallery_file = 'portal/resource_gallery.yaml'
with open(submission_file) as f:
data = json.load(f)

with open(resource_gallery_file) as f:
resource_gallery = yaml.load(f)
with open(submission_file, 'r') as file:
data = json.load(file)

with open(resource_gallery_file, 'w') as f:
resource_gallery.append(data)
yaml.dump(resource_gallery, f)
with open(resource_gallery_file, 'w') as yaml_file:
yaml.dump(data, yaml_file)

- name: Run pre-commit hooks
run: |
Expand Down
Loading