> For the complete documentation index, see [llms.txt](https://help.genesis.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.genesis.autify.com/features-ko/workflow/github-webhook-trigger-context.md).

# Webhook 트리거 컨텍스트

GitHub Webhook을 사용하여 워크플로를 자동 실행하면, 트리거가 된 GitHub 이벤트의 메타데이터가 컨텍스트로 자동 생성됩니다. 이 문서에서는 각 이벤트에서 전달되는 컨텍스트 필드 목록을 설명합니다.

## 컨텍스트 동작

GitHub Webhook에 의해 워크플로가 트리거되면, 시스템은 이벤트의 페이로드에서 메타데이터를 추출하여 **트리거 컨텍스트**로 구조화합니다. 이 컨텍스트는 워크플로 안의 AI 에이전트 블록의 시스템 프롬프트에 자동으로 부여되므로, AI는 명시적인 설정 없이 트리거의 메타데이터를 참조할 수 있습니다.

## 모든 이벤트 공통 필드

모든 GitHub Webhook 이벤트에서 항상 전달되는 필드입니다.

| 필드명          | 설명                    | 예                                 |
| ------------ | --------------------- | --------------------------------- |
| `event`      | 트리거가 된 이벤트 종류         | `push`, `pull_request`, `release` |
| `repository` | 리포지토리의 전체 이름          | `owner/repo-name`                 |
| `branch`     | 베이스 브랜치 이름            | `main`, `release/v2`              |
| `sender`     | 이벤트를 발생시킨 사용자의 로그인 이름 | `username`                        |

{% hint style="info" %}
모든 필드의 값은 문자열 형식으로 전달됩니다. 숫자(PR 번호 등)도 문자열로 전달됩니다.
{% endhint %}

## 이벤트별 필드

### 푸시(push)

코드가 브랜치에 푸시되었을 때 전달되는 추가 필드입니다.

| 필드명             | 설명           | 예                                             |
| --------------- | ------------ | --------------------------------------------- |
| `commitSha`     | HEAD 커밋의 SHA | `abc123def456...`                             |
| `commitMessage` | HEAD 커밋의 메시지 | `Fix: 로그인 처리 수정`                              |
| `commitUrl`     | HEAD 커밋의 URL | `https://github.com/owner/repo/commit/abc123` |
| `commitCount`   | 푸시에 포함된 커밋 수 | `3`                                           |

### 풀 리퀘스트(pull\_request)

풀 리퀘스트가 열리거나·업데이트되거나·닫혔을 때 전달되는 추가 필드입니다.

| 필드명          | 설명              | 예                                       |
| ------------ | --------------- | --------------------------------------- |
| `action`     | PR에 대해 수행된 액션   | `opened`, `closed`, `synchronize`       |
| `prNumber`   | PR의 번호          | `42`                                    |
| `prTitle`    | PR의 제목          | `Feature: 새 대시보드`                       |
| `prUrl`      | PR의 URL         | `https://github.com/owner/repo/pull/42` |
| `headBranch` | PR의 소스 브랜치      | `feature/new-dashboard`                 |
| `baseBranch` | PR의 타깃 브랜치      | `main`                                  |
| `headSha`    | PR의 HEAD 커밋 SHA | `def456abc123...`                       |
| `merged`     | PR이 머지되었는지 여부   | `true`, `false`                         |

### 릴리스(release)

새 릴리스가 게시되었을 때 전달되는 추가 필드입니다.

| 필드명           | 설명             | 예                                                   |
| ------------- | -------------- | --------------------------------------------------- |
| `action`      | 릴리스에 대해 수행된 액션 | `published`, `created`, `edited`                    |
| `tagName`     | 릴리스의 태그 이름     | `v1.2.3`                                            |
| `releaseName` | 릴리스의 명칭        | `Version 1.2.3`                                     |
| `releaseUrl`  | 릴리스의 URL       | `https://github.com/owner/repo/releases/tag/v1.2.3` |
| `prerelease`  | 프리릴리스인지 여부     | `true`, `false`                                     |

## 컨텍스트 참조 방법

AI 에이전트 블록의 시스템 프롬프트에는 다음과 같은 형식으로 트리거 컨텍스트가 자동으로 부여됩니다.

```
## Trigger Context
This workflow was automatically triggered. Here is the trigger metadata:
- **type**: github
- **event**: push
- **repository**: owner/repo-name
- **branch**: main
- **sender**: username
- **commitSha**: abc123def456...
- **commitMessage**: Fix: 로그인 처리 수정
- **commitUrl**: https://github.com/owner/repo/commit/abc123
- **commitCount**: 1
```

AI 에이전트 블록의 프롬프트에 "커밋 메시지를 요약해 주세요"라고 작성하기만 하면, AI는 컨텍스트에서 커밋 정보를 자동으로 참조할 수 있습니다.

## 참고 자료

* [워크플로 실행](/features-ko/workflow/workflow-execution.md)
* [GitHub 연동](/features-ko/resources-context/github-integration.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.genesis.autify.com/features-ko/workflow/github-webhook-trigger-context.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
