Skip to content

Commit c81a92b

Browse files
authored
Merge 02113ff into b3c1df0
2 parents b3c1df0 + 02113ff commit c81a92b

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/update-resource-gallery.yaml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
types:
66
- opened
77
- edited
8+
89
jobs:
910
validate-user-submission:
1011
if: |
@@ -87,21 +88,14 @@ jobs:
8788
- name: Update resource gallery
8889
shell: python
8990
run: |
91+
import yaml
9092
import json
91-
from ruamel.yaml import YAML
92-
93-
yaml = YAML()
94-
submission_file = 'resource-gallery-submission-input.json'
95-
resource_gallery_file = 'portal/resource_gallery.yaml'
96-
with open(submission_file) as f:
97-
data = json.load(f)
9893
99-
with open(resource_gallery_file) as f:
100-
resource_gallery = yaml.load(f)
94+
with open(submission_file, 'r') as file:
95+
data = json.load(file)
10196
102-
with open(resource_gallery_file, 'w') as f:
103-
resource_gallery.append(data)
104-
yaml.dump(resource_gallery, f)
97+
with open(resource_gallery_file, 'w') as yaml_file:
98+
yaml.dump(data, yaml_file)
10599
106100
- name: Run pre-commit hooks
107101
run: |

0 commit comments

Comments
 (0)