Skip to content

Commit

Permalink
Try fix: 在 commit 提交出现问题时, 改为显示提交主内容
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperScript-PRC committed Nov 29, 2024
1 parent 0529ebf commit 8543b14
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions .github/release_produce.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@ def generate_changelog(repo, max_version, version_file="version"):
)

new_commits_list = new_commits_log.split("\n")
new_real_commits_list = [json.loads(item) for item in new_commits_list if item]
new_real_commits_list = []
for item in new_commits_list:
if item:
try:
item = json.loads(item)
item.update({"avali": True})
except json.JSONDecodeError:
item = {
"commit": "Error",
"author": "Error",
"summary": item,
"date": "Error",
"avali": False
}
new_real_commits_list.append(item)


ToolDeltaVersion = open(version_file).read().strip()

Expand All @@ -46,17 +61,22 @@ def generate_changelog(repo, max_version, version_file="version"):
date = commit["date"]
if "github-actions" in summary or "GitHub" in summary:
continue
CHANGELOG.write(
f"- [[`{commit_id[:7]}`](https://github.com/ToolDelta/ToolDelta/commit/{commit_id})] {summary} By {author} ({date})\n"
)
if commit["avali"]:
CHANGELOG.write(
f"- [[`{commit_id[:7]}`](https://github.com/ToolDelta/ToolDelta/commit/{commit_id})] {summary} By {author} ({date})\n"
)
else:
CHANGELOG.write(
f"- [`{commit_id[:7]}`] {summary}\n"
)

def main():
repo_path = "/home/runner/work/Test"
repo_url = "https://github.com/ToolDelta/ToolDelta.git"

# repo_path = "/home/xingchen/WorkSpace/ToolDelta/.github/test"
# repo_url = "https://tdload.tblstudio.cn/https://github.com/ToolDelta/ToolDelta.git"

repo = clone_repo(repo_url, repo_path)
repo.git.pull()

Expand Down

0 comments on commit 8543b14

Please sign in to comment.