WebHook broker that accepts notifications from multiple platforms and performs simple actions in response
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. }