Skip to main content

웹후크 만들기

You can create webhooks to subscribe to specific events that occur on GitHub.

About creating webhooks

You can create webhooks to subscribe to specific events on GitHub that occur in a repository, organization, GitHub Marketplace account, or GitHub Sponsors account. You can also set up a GitHub App to recieve webhooks when specific events occur on GitHub.

For more information about the different types of webhooks, see "About webhooks." For a complete list of webhook events, see "Webhook events and payloads."

Creating a repository webhook

You can create a webhook to subscribe to events that occur in a specific repository. You must be a repository owner or have admin access in the repository to create webhooks in that repository.

You can use the GitHub web interface or the REST API to create a repository webhook. For more information about using the REST API to create a repository webhook, see "Repository Webhooks."

  1. On GitHub.com, navigate to the main page of the repository.
  2. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings. Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.
  3. In the left sidebar, click Webhooks.
  4. Click Add webhook.
  5. Under "Payload URL", type the URL where you'd like to receive payloads.
  6. Optionally, select the Content type drop-down menu, and click a data format to receive the webhook payload in.
    • application/json will deliver the JSON payload directly as the body of the POST request.
    • application/x-www-form-urlencoded will send the JSON payload as a form parameter called payload.
  7. Optionally, under "Secret", type a string to use as a secret key. You should choose a random string of text with high entropy. You can use the webhook secret to limit incoming requests to only those originating from GitHub. For more information, see "Securing your webhooks."
  8. Under "Which events would you like to trigger this webhook?", select the webhook events that you want to receive. You should only subscribe to the webhook events that you need.
  9. If you chose Let me select individual events, select the events that you want to trigger the webhook.
  10. To make the webhook active immediately after adding the configuration, select Active.
  11. Click Add webhook.

After you create a new webhook, GitHub will send you a simple ping event to let you know you've set up the webhook correctly. For more information, see "Webhook events and payloads."

Creating an organization webhook

You can create a webhook to subscribe to events that occur in a specific organization. You must be an organization owner to create webhooks in that organization.

You can use the GitHub web interface or the REST API to create an organization webhook. For more information about using the REST API to create an organization webhook, see "Organization webhooks."

  1. In the upper-right corner of any page on GitHub.com, click your profile photo.
  2. Click Your organizations.
  3. To the right of the organization, click Settings.
  4. In the left sidebar, click Webhooks.
  5. Click Add webhook.
  6. Under "Payload URL", type the URL where you'd like to receive payloads.
  7. Optionally, select the Content type drop-down menu, and click a data format to receive the webhook payload in.
    • application/json will deliver the JSON payload directly as the body of the POST request.
    • application/x-www-form-urlencoded will send the JSON payload as a form parameter called payload.
  8. Optionally, under "Secret", type a string to use as a secret key. You should choose a random string of text with high entropy. You can use the webhook secret to limit incoming requests to only those originating from GitHub. For more information, see "Securing your webhooks."
  9. Under "Which events would you like to trigger this webhook?", select the types of webhooks you'd like to recieve. You should only subscribe to the webhook events that you need.
  10. If you chose Let me select individual events, select the events that will trigger the webhook.
  11. To make the webhook active immediately after adding the configuration, select Active.
  12. Click Add webhook.

After you create a new webhook, GitHub will send you a simple ping event to let you know you've set up the webhook correctly. For more information, see "Webhook events and payloads."

Creating a GitHub Marketplace webhook

You can create a webhook to subscribe to events relating to an app that you published in GitHub Marketplace. Only the owner of the app, or an app manager for the organization that owns the app, can create a GitHub Marketplace webhook. For more information, see "Webhook events for the GitHub Marketplace API."

  1. Navigate to your GitHub Marketplace listing page.
  2. Next to the GitHub Marketplace listing that you want to view webhook deliveries for, click Manage listing.
  3. In the sidebar, click Webhook.
  4. Under "Payload URL", type the URL where you'd like to receive payloads.
  5. Optionally, select the Content type drop-down menu, and click a data format to receive the webhook payload in.
    • application/json will deliver the JSON payload directly as the body of the POST request.
    • application/x-www-form-urlencoded will send the JSON payload as a form parameter called payload.
  6. Optionally, under "Secret", type a string to use as a secret key. You should choose a random string of text with high entropy. You can use the webhook secret to limit incoming requests to only those originating from GitHub. For more information, see "Securing your webhooks."
  7. To make the webhook active immediately after adding the configuration, select Active.
  8. Click Create webhook.

After you create a new webhook, GitHub will send you a simple ping event to let you know you've set up the webhook correctly. For more information, see "Webhook events and payloads."

Creating a GitHub Sponsors webhook

You can create a webhook to subscribe to events relating to GitHub Sponsors. Only the owner of the sponsored account can create sponsorship webhooks for that account. For more information, see "Configuring webhooks for events in your sponsored account."

Creating webhooks for a GitHub App

You can subscribe your GitHub App to webhook events to receive notifications whenever certain events occur. For more information, see "Registering a GitHub App" and "Using webhooks with GitHub Apps."

Further reading