Skip to content

Commit

Permalink
feat(fetch-releases): Init save_to_json func
Browse files Browse the repository at this point in the history
  • Loading branch information
haruki7049 committed Jul 17, 2024
1 parent d9da941 commit 61c1774
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fetch-releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,18 @@ def get_all_releases(owner: str, repo: str) -> list:
break

return releases


def save_to_json(sources: dict, filename: str):
"""
Save json to a file
Parameters
----------
json : list
JSON data which will be saved to a file
filename : str
File name to save the JSON data
"""
with open(filename, "w") as file:
json.dump(sources, file, indent=2)

0 comments on commit 61c1774

Please sign in to comment.