Skip to content

Commit 2b4a61c

Browse files
authored
Merge pull request #11 from aksh1618/claude/issue-8-20250523_035323
[Claude Code] feat: avoid updating gist if content and title are unchanged
2 parents 2cd3cba + ecae6f4 commit 2b4a61c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

codestats_box.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,16 @@ def update_gist(title: str, content: str) -> bool:
212212
gist = Github(access_token).get_gist(gist_id)
213213
# Works only for single file. Should we clear all files and create new file?
214214
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+
215222
gist.edit(title, {old_title: InputFileContent(content, title)})
216223
print(f"{title}\n{content}")
224+
return True
217225

218226

219227
def get_stats() -> str:

0 commit comments

Comments
 (0)