Skip to content

Commit 844b2d9

Browse files
authored
Update update-resource-gallery.yaml
Correct the fact that json file data being dumped into yaml file with incorrect format
1 parent b3c1df0 commit 844b2d9

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,14 @@ jobs:
8787
- name: Update resource gallery
8888
shell: python
8989
run: |
90+
import yaml
9091
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)
98-
99-
with open(resource_gallery_file) as f:
100-
resource_gallery = yaml.load(f)
101-
102-
with open(resource_gallery_file, 'w') as f:
103-
resource_gallery.append(data)
104-
yaml.dump(resource_gallery, f)
92+
93+
with open(submission_file, 'r') as file:
94+
data = json.load(file)
95+
96+
with open(resource_gallery_file, 'w') as yaml_file:
97+
yaml.dump(data, yaml_file)
10598
10699
- name: Run pre-commit hooks
107100
run: |

0 commit comments

Comments
 (0)