@@ -47,39 +47,26 @@ jobs:
4747 new_data = None
4848
4949 if new_data is not None:
50- old_dict = {item['url']: item['commits '] for item in old_data if isinstance(item, dict) and 'url' in item and 'commits ' in item}
51- new_dict = {item['url']: item['commits '] for item in new_data if isinstance(item, dict) and 'url' in item and 'commits ' in item}
50+ old_dict = {item['url']: item['hash '] for item in old_data if isinstance(item, dict) and 'url' in item and 'hash ' in item}
51+ new_dict = {item['url']: item['hash '] for item in new_data if isinstance(item, dict) and 'url' in item and 'hash ' in item}
5252
53- found = False
54- for url, new_commits in new_dict.items():
55- if url in old_dict and isinstance(new_commits, dict):
56- old_commits = old_dict[url]
57- if not isinstance(old_commits, dict):
58- continue
59-
60- # Get the single version key and its new SHA
61- for version, new_sha in new_commits.items():
62- old_values = list(old_commits.values())
63- if not old_values:
64- continue
65- # Fallback to absolute positional value if the app version key itself was updated
66- old_sha = old_commits.get(version) or old_values[0]
67-
68- # Trigger if the commit hash changed
69- if old_sha != new_sha:
70- plugin_name = url.split('/')[-1]
71- changelog_url = f"{url}/compare/{old_sha}...{new_sha}"
72-
73- # Creates a clean display string like: "a459c67...bd2cfc3"
74- display_text = f"{old_sha[:7]}...{new_sha[:7]}"
75-
76- with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
77- f.write(f"plugin_name={plugin_name}\n")
78- f.write(f"changelog_url={changelog_url}\n")
79- f.write(f"display_text={display_text}\n")
80- found = True
81- break
82- if found:
53+ for url, new_sha in new_dict.items():
54+ old_sha = old_dict.get(url)
55+ if not old_sha or not new_sha:
56+ continue
57+
58+ # Trigger if the commit hash changed
59+ if old_sha != new_sha:
60+ plugin_name = url.split('/')[-1]
61+ changelog_url = f"{url}/compare/{old_sha}...{new_sha}"
62+
63+ # Creates a clean display string like: "a459c67...bd2cfc3"
64+ display_text = f"{old_sha[:7]}...{new_sha[:7]}"
65+
66+ with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
67+ f.write(f"plugin_name={plugin_name}\n")
68+ f.write(f"changelog_url={changelog_url}\n")
69+ f.write(f"display_text={display_text}\n")
8370 break
8471
8572 - name : Send Message via Discord Bot
0 commit comments