We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2cd3cba + ecae6f4 commit 2b4a61cCopy full SHA for 2b4a61c
codestats_box.py
@@ -212,8 +212,16 @@ def update_gist(title: str, content: str) -> bool:
212
gist = Github(access_token).get_gist(gist_id)
213
# Works only for single file. Should we clear all files and create new file?
214
old_title = list(gist.files.keys())[0]
215
+
216
+ # Check if content has changed to avoid unnecessary updates
217
+ current_content = gist.files[old_title].content
218
+ if current_content == content and old_title == title:
219
+ print(f"No changes detected. Skipping gist update.")
220
+ return False
221
222
gist.edit(title, {old_title: InputFileContent(content, title)})
223
print(f"{title}\n{content}")
224
+ return True
225
226
227
def get_stats() -> str:
0 commit comments