Skip to content

Commit 3729e1a

Browse files
jukenterogluorhanpre-commit-ci[bot]
authored
Update resource gallery (#468)
* Update update-resource-gallery.yaml Correct the fact that json file data being dumped into yaml file with incorrect format * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Simple line break added * don't overwrite yaml data * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Orhan Eroglu <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ea3f5f4 commit 3729e1a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,15 @@ jobs:
9595
resource_gallery_file = 'portal/resource_gallery.yaml'
9696
9797
with open(submission_file, 'r') as file:
98-
data = json.load(file)
98+
new_data = json.load(file)
99+
100+
with open(resource_gallery_file, 'r') as yaml_file:
101+
existing_data = yaml.load(yaml_file) or []
102+
103+
existing_data.append(new_data)
99104
100105
with open(resource_gallery_file, 'w') as yaml_file:
101-
yaml.dump(data, yaml_file)
106+
yaml.dump(existing_data, yaml_file, default_flow_style=False)
102107
103108
- name: Run pre-commit hooks
104109
run: |

0 commit comments

Comments
 (0)