Parcourir la source

Fix git commit message handling.

Only include the first line. Reverse order of commits so they're
chronological.
master
Chris Smith il y a 6 ans
Parent
révision
4cc8b68c95
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3
    2
      main.py

+ 3
- 2
main.py Voir le fichier

18
                     f"\002[git]\002 {event['user']} pushed {len(event['commits'])} commit{'s' if len(event['commits']) != 1 else ''} to {event['repo']['name']}: {event['compare_url']}"
18
                     f"\002[git]\002 {event['user']} pushed {len(event['commits'])} commit{'s' if len(event['commits']) != 1 else ''} to {event['repo']['name']}: {event['compare_url']}"
19
                 )
19
                 )
20
 
20
 
21
-                for commit in event["commits"][:3]:
21
+                for commit in event["commits"][::-1][:3]:
22
+                    line = commit["message"].split("\n")[0][:100]
22
                     services["reportbot"].announce(
23
                     services["reportbot"].announce(
23
-                        f"\002[git]\002 {commit['id']}: {commit['message'][:100]}"
24
+                        f"\002[git]\002 {commit['id']}: {line}"
24
                     )
25
                     )
25
         elif event["type"] == "docker.push":
26
         elif event["type"] == "docker.push":
26
             services["reportbot"].announce(
27
             services["reportbot"].announce(

Chargement…
Annuler
Enregistrer