Skip to content

Commit c5cd227

Browse files
committed
don't overwrite yaml data
1 parent 02113ff commit c5cd227

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,15 @@ jobs:
9292
import json
9393
9494
with open(submission_file, 'r') as file:
95-
data = json.load(file)
95+
new_data = json.load(file)
9696
97+
with open(resource_gallery_file, 'r') as yaml_file:
98+
existing_data = yaml.load(yaml_file) or []
99+
100+
existing_data.append(new_data)
101+
97102
with open(resource_gallery_file, 'w') as yaml_file:
98-
yaml.dump(data, yaml_file)
103+
yaml.dump(existing_data, yaml_file, default_flow_style=False)
99104
100105
- name: Run pre-commit hooks
101106
run: |

0 commit comments

Comments
 (0)