mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
Show correct commit count when more than 20
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -40,4 +40,5 @@ jobs:
|
||||
- name: Send webhook
|
||||
env:
|
||||
DEV_WEBHOOK: "https://discord.com/api/webhooks/${{ secrets.DEV_WEBHOOK_ID }}/${{ secrets.DEV_WEBHOOK_TOKEN }}"
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
run: python .github/workflow_data/webhook.py
|
||||
|
||||
Reference in New Issue
Block a user