mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Show correct commit count when more than 20
This commit is contained in:
8
.github/workflow_data/webhook.py
vendored
8
.github/workflow_data/webhook.py
vendored
@@ -17,6 +17,14 @@ if __name__ == "__main__":
|
||||
match os.environ["GITHUB_EVENT_NAME"]:
|
||||
case "push":
|
||||
count = len(event["commits"])
|
||||
if count == 20:
|
||||
count = int(requests.get(
|
||||
event["compare"].replace("github.com", "api.github.com/repos"),
|
||||
headers={
|
||||
"Accept": "application/vnd.github.v3+json",
|
||||
"Authorization": f"token {os.environ['GITHUB_TOKEN']}"
|
||||
}
|
||||
).json()["total_commits"])
|
||||
branch = event["ref"].removeprefix("refs/heads/")
|
||||
change = (
|
||||
"Force Push"
|
||||
|
||||
Reference in New Issue
Block a user