# GitHub 웹훅을 Pocket Alert에 연동하는 방법

> GitHub 웹훅을 연결하는 몇 가지 간단한 단계

*19.06.2024*

<!-- source: https://pocketalert.app/ko/blog/how-to-integrate-github-webhooks-into-pocket-alert -->

[//]: # '# How to integrate GitHub webhooks into pocket alert'

## 새 웹훅 만들기

![create webhook](https://cdn.pocketalert.app/guides/git/webhook-create.gif)

1. [Webhooks](https://pocketalert.app/webhooks) 페이지로 이동합니다
2. "Create" 버튼을 클릭합니다
3. 다음 정보를 사이트 양식에 입력합니다:
   - **Name**: 웹훅의 이름
   - **Application**: 웹훅을 연결할 애플리케이션
   - **Device**: 웹훅을 연결할 기기
   - **Message**: 웹훅이 실행될 때 보낼 메시지
4. "Create" 버튼을 클릭합니다
5. 웹훅의 URL을 복사합니다

**메시지에서 \* 를 지정하면 모든 JSON을 가져와서 필요한 매개변수를 직접 정할 수 있습니다.**

## GitHub에 웹훅 추가하기

![github add webhook](https://cdn.pocketalert.app/guides/git/github-add-webhook.gif)

1. 저장소 설정으로 이동합니다
2. "Webhooks" 탭을 클릭합니다
3. "Add webhook" 버튼을 클릭합니다
4. 다음 정보를 양식에 입력합니다:
   - **Payload URL**: 웹훅의 URL을 붙여넣습니다
   - **Content type**: application/json
   - **Secret**: 웹훅의 시크릿
   - **Which events would you like to trigger this webhook?**: 웹훅을 실행할 이벤트를 선택합니다
   - "Add webhook" 버튼을 클릭합니다
5. 저장소에 커밋을 푸시해서 웹훅을 테스트합니다

## 최종 설정

GitHub에서 웹훅을 설정하고 저장소에 커밋을 푸시하면 Pocket Alert 앱에서 메시지를 확인할 수 있습니다.

알림을 생성하는 데 필요한 변수를 정의할 수 있습니다.

예를 들어 커밋 메시지를 가져오고 싶다면 다음 코드를 사용할 수 있습니다:

![webhook update](https://cdn.pocketalert.app/guides/git/github-webhook-update.png)

```json Commit: %head_commit.message%
Author: %head_commit.author.name%

Date: %head_commit.timestamp%
```

변수에 대한 자세한 내용은 [Webhook Settings](https://info.pocketalert.app/api/webhooks/settings.html)에서 확인할 수 있습니다.

## Pocket Alert 앱의 메시지 예시

![messages](https://cdn.pocketalert.app/guides/git/github-webhook-messages.png)

---

![message](https://cdn.pocketalert.app/guides/git/github-webhook-message.png)

## 마치며

이 가이드에서는 GitHub 웹훅을 Pocket Alert 앱에 연동하는 방법을 살펴보았습니다. 새 웹훅을 만들고, GitHub에 웹훅을 추가하고, Pocket Alert 앱에서 메시지를 사용하는 방법을 알아보았습니다. 또한 Pocket Alert 앱의 메시지 예시도 확인했습니다. 이 가이드가 도움이 되었기를 바랍니다. 궁금한 점이 있으시면 언제든지 문의해 주세요. 도움이 되어 드리겠습니다. 이 가이드를 읽어 주셔서 감사합니다.
