Skip to content

Commit

Permalink
Update resource gallery (#468)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent ea3f5f4 commit 3729e1a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/update-resource-gallery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 3729e1a

Please sign in to comment.