WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

docker.py 720B

123456789101112131415161718192021
  1. from .service import Service
  2. class Docker(Service):
  3. def __init__(self):
  4. super().__init__("docker")
  5. def accept_hook(self, identifier, request):
  6. for event in request.get_json()["events"]:
  7. if (
  8. event["action"] == "push"
  9. and "vnd.docker.distribution.manifest" in event["target"]["mediaType"]
  10. and "tag" in event["target"]
  11. ):
  12. yield {
  13. "type": "docker.push",
  14. "repo": event["target"]["repository"],
  15. "tag": event["target"]["tag"],
  16. "host": event["request"]["host"],
  17. "user": event["actor"]["name"],
  18. }