diff --git a/.github/workflows/update-resource-gallery.yaml b/.github/workflows/update-resource-gallery.yaml index ab1e9371..2351c2ca 100644 --- a/.github/workflows/update-resource-gallery.yaml +++ b/.github/workflows/update-resource-gallery.yaml @@ -95,10 +95,15 @@ jobs: resource_gallery_file = 'portal/resource_gallery.yaml' with open(submission_file, 'r') as file: - data = json.load(file) + new_data = json.load(file) + + with open(resource_gallery_file, 'r') as yaml_file: + existing_data = yaml.load(yaml_file) or [] + + existing_data.append(new_data) with open(resource_gallery_file, 'w') as yaml_file: - yaml.dump(data, yaml_file) + yaml.dump(existing_data, yaml_file, default_flow_style=False) - name: Run pre-commit hooks run: |