You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

webhooks.en-us.md 2.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. ---
  2. date: "2016-12-01T16:00:00+02:00"
  3. title: "Webhooks"
  4. slug: "webhooks"
  5. weight: 10
  6. toc: true
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "features"
  11. name: "Webhooks"
  12. weight: 30
  13. identifier: "webhooks"
  14. ---
  15. # Webhooks
  16. Gitea supports web hooks for repository events, you can find it in settings page(`/:username/:reponame/settings/hooks`). All event pushes are POST requests, and we currently support two formats: Gitea and Slack.
  17. ### Event information
  18. Following shows an example of event information that will be sent by Gitea to Payload URL:
  19. ```
  20. X-Github-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
  21. X-Github-Event: push
  22. X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
  23. X-Gogs-Event: push
  24. X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
  25. X-Gitea-Event: push
  26. ```
  27. ```json
  28. {
  29. "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3",
  30. "ref": "refs/heads/develop",
  31. "before": "28e1879d029cb852e4844d9c718537df08844e03",
  32. "after": "bffeb74224043ba2feb48d137756c8a9331c449a",
  33. "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a",
  34. "commits": [
  35. {
  36. "id": "bffeb74224043ba2feb48d137756c8a9331c449a",
  37. "message": "Webhooks Yay!",
  38. "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a",
  39. "author": {
  40. "name": "Gitea",
  41. "email": "someone@gitea.io",
  42. "username": "gitea"
  43. },
  44. "committer": {
  45. "name": "Gitea",
  46. "email": "someone@gitea.io",
  47. "username": "gitea"
  48. },
  49. "timestamp": "2017-03-13T13:52:11-04:00"
  50. }
  51. ],
  52. "repository": {
  53. "id": 140,
  54. "owner": {
  55. "id": 1,
  56. "login": "gitea",
  57. "full_name": "Gitea",
  58. "email": "someone@gitea.io",
  59. "avatar_url": "https://localhost:3000/avatars/1",
  60. "username": "gitea"
  61. },
  62. "name": "webhooks",
  63. "full_name": "gitea/webhooks",
  64. "description": "",
  65. "private": false,
  66. "fork": false,
  67. "html_url": "http://localhost:3000/gitea/webhooks",
  68. "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git",
  69. "clone_url": "http://localhost:3000/gitea/webhooks.git",
  70. "website": "",
  71. "stars_count": 0,
  72. "forks_count": 1,
  73. "watchers_count": 1,
  74. "open_issues_count": 7,
  75. "default_branch": "master",
  76. "created_at": "2017-02-26T04:29:06-05:00",
  77. "updated_at": "2017-03-13T13:51:58-04:00"
  78. },
  79. "pusher": {
  80. "id": 1,
  81. "login": "gitea",
  82. "full_name": "Gitea",
  83. "email": "someone@gitea.io",
  84. "avatar_url": "https://localhost:3000/avatars/1",
  85. "username": "gitea"
  86. },
  87. "sender": {
  88. "id": 1,
  89. "login": "gitea",
  90. "full_name": "Gitea",
  91. "email": "someone@gitea.io",
  92. "avatar_url": "https://localhost:3000/avatars/1",
  93. "username": "gitea"
  94. }
  95. }
  96. ```