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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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, this can be found in the settings
  17. page(`/:username/:reponame/settings/hooks`). All event pushes are POST requests.
  18. The two methods currently supported are Gitea and Slack.
  19. ### Event information
  20. The following is an example of event information that will be sent by Gitea to
  21. a Payload URL:
  22. ```
  23. X-Github-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
  24. X-Github-Event: push
  25. X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
  26. X-Gogs-Event: push
  27. X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473
  28. X-Gitea-Event: push
  29. ```
  30. ```json
  31. {
  32. "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3",
  33. "ref": "refs/heads/develop",
  34. "before": "28e1879d029cb852e4844d9c718537df08844e03",
  35. "after": "bffeb74224043ba2feb48d137756c8a9331c449a",
  36. "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a",
  37. "commits": [
  38. {
  39. "id": "bffeb74224043ba2feb48d137756c8a9331c449a",
  40. "message": "Webhooks Yay!",
  41. "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a",
  42. "author": {
  43. "name": "Gitea",
  44. "email": "someone@gitea.io",
  45. "username": "gitea"
  46. },
  47. "committer": {
  48. "name": "Gitea",
  49. "email": "someone@gitea.io",
  50. "username": "gitea"
  51. },
  52. "timestamp": "2017-03-13T13:52:11-04:00"
  53. }
  54. ],
  55. "repository": {
  56. "id": 140,
  57. "owner": {
  58. "id": 1,
  59. "login": "gitea",
  60. "full_name": "Gitea",
  61. "email": "someone@gitea.io",
  62. "avatar_url": "https://localhost:3000/avatars/1",
  63. "username": "gitea"
  64. },
  65. "name": "webhooks",
  66. "full_name": "gitea/webhooks",
  67. "description": "",
  68. "private": false,
  69. "fork": false,
  70. "html_url": "http://localhost:3000/gitea/webhooks",
  71. "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git",
  72. "clone_url": "http://localhost:3000/gitea/webhooks.git",
  73. "website": "",
  74. "stars_count": 0,
  75. "forks_count": 1,
  76. "watchers_count": 1,
  77. "open_issues_count": 7,
  78. "default_branch": "master",
  79. "created_at": "2017-02-26T04:29:06-05:00",
  80. "updated_at": "2017-03-13T13:51:58-04:00"
  81. },
  82. "pusher": {
  83. "id": 1,
  84. "login": "gitea",
  85. "full_name": "Gitea",
  86. "email": "someone@gitea.io",
  87. "avatar_url": "https://localhost:3000/avatars/1",
  88. "username": "gitea"
  89. },
  90. "sender": {
  91. "id": 1,
  92. "login": "gitea",
  93. "full_name": "Gitea",
  94. "email": "someone@gitea.io",
  95. "avatar_url": "https://localhost:3000/avatars/1",
  96. "username": "gitea"
  97. }
  98. }
  99. ```