Skip to content
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