Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Hopefully add new indicator for devbuilds in progress
Browse files Browse the repository at this point in the history
I think this works? lmao...
  • Loading branch information
Clara K authored Apr 18, 2024
1 parent fc09d04 commit 4ac98ca
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflow_data/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

match os.environ["GITHUB_EVENT_NAME"]:
case "push":
max_length_reached = False
webhook = "BUILD_WEBHOOK"
count = len(event["commits"])
if count == 20:
Expand All @@ -36,10 +37,15 @@
for i, commit in enumerate(event["commits"]):
msg = commit['message'].splitlines()[0].replace("`", "")
msg = msg[:50] + ("..." if len(msg) > 50 else "")
desc += f"\n[`{commit['id'][:7]}`]({commit['url']}): {msg} - [__{commit['author'].get('username')}__](https://github.com/{commit['author'].get('username')})"
if len(desc) > 2020:
desc = desc.rsplit("\n", 1)[0] + f"\n+ {count - i} more commits"
break
if not max_length_reached:
if len(desc) <= 1984:
desc += f"\n[`{commit['id'][:7]}`]({commit['url']}): {msg} - [__{commit['author'].get('username')}__](https://github.com/{commit['author'].get('username')})"
else:
desc = desc.rsplit("\n", 1)[0] + f"\n+ {count - i} more commits"
max_length_reached = True
is_building = "nobuild" not in commit['message']

desc+= f"Build in progress for this commit: {is_building}"
url = event["compare"]
color = 16723712 if event["forced"] else 3669797

Expand Down

0 comments on commit 4ac98ca

Please sign in to comment.