Skip to main content

Managing pre-receive hooks on your instance

Configure how people will use pre-receive hooks on GitHub Enterprise Server 인스턴스.

Creating pre-receive hooks

  1. GitHub Enterprise Server의 오른쪽 위 모서리에서 프로필 사진과 엔터프라이즈 설정을 차례로 클릭합니다.

    GitHub Enterprise Server에서 프로필 사진 클릭할 때 나타나는 드롭다운 메뉴의 스크린샷 "엔터프라이즈 설정" 옵션이 진한 주황색 윤곽선으로 강조 표시됩니다.

  2. 엔터프라이즈 계정 사이드바에서 설정을 선택합니다.

  3. " 설정"에서 후크를 클릭합니다.

  4. Click Add pre-receive hook.

  5. In the "Hook name" field, enter the name of the hook that you want to create.

  6. Select the Environment dropdown menu, then click the environment on which you want the hook to run.

  7. Under "Script," select the Select hook repository dropdown menu, then click the repository that contains your pre-receive hook script.

  8. Select the Select file drop-down menu, then click the filename of the pre-receive hook script.

  9. To enforce your script, select Use the exit-status to accept or reject pushes. Deselecting this option allows you to test the script while the exit-status value is ignored. In this mode, the output of the script will be visible to the user in the command-line but not on the web interface.

  10. If you want the pre-receive hook to run on all repositories, select Enable this pre-receive hook on all repositories by default.

  11. To allow organization members with admin or owner permissions to select whether they wish to enable or disable this pre-receive hook, select Administrators can enable and disable this hook.

Editing pre-receive hooks

  1. GitHub Enterprise Server의 오른쪽 위 모서리에서 프로필 사진과 엔터프라이즈 설정을 차례로 클릭합니다.

    GitHub Enterprise Server에서 프로필 사진 클릭할 때 나타나는 드롭다운 메뉴의 스크린샷 "엔터프라이즈 설정" 옵션이 진한 주황색 윤곽선으로 강조 표시됩니다.

  2. 엔터프라이즈 계정 사이드바에서 설정을 선택합니다.

  3. " 설정"에서 후크를 클릭합니다.

  4. Next to the pre-receive hook that you want to edit, click Edit.

Deleting pre-receive hooks

  1. GitHub Enterprise Server의 오른쪽 위 모서리에서 프로필 사진과 엔터프라이즈 설정을 차례로 클릭합니다.

    GitHub Enterprise Server에서 프로필 사진 클릭할 때 나타나는 드롭다운 메뉴의 스크린샷 "엔터프라이즈 설정" 옵션이 진한 주황색 윤곽선으로 강조 표시됩니다.

  2. 엔터프라이즈 계정 사이드바에서 설정을 선택합니다.

  3. " 설정"에서 후크를 클릭합니다.

  4. Next to the pre-receive hook that you want to delete, click Delete.

Configure pre-receive hooks for an organization

An organization owner can only configure hook permissions for an organization if the site administrator selected the Administrators can enable or disable this hook option when they created the pre-receive hook. To configure pre-receive hooks for a repository, you must be an organization owner.

  1. GitHub의 오른쪽 위 모서리에서 프로필 사진을 선택하고 조직을 클릭합니다.
  2. 조직 옆에 있는 설정을 클릭합니다.
  3. In the left sidebar, click Hooks.
  4. Next to the pre-receive hook that you want to configure, select the Hook permissions dropdown menu, then click an option.

Configure pre-receive hooks for a repository

A repository owner can only configure a hook if the site administrator selected the Administrators can enable or disable this hook option when they created the pre-receive hook. In an organization, the organization owner must also have selected the Configurable hook permission. To configure pre-receive hooks for a repository, you must be a repository owner.

  1. GitHub Enterprise Server의 오른쪽 위 모서리에서 프로필 사진을 클릭한 다음, 프로필을 클릭합니다.

  2. Navigate to the repository that you want to configure pre-receive hooks for.

  3. 리포지토리 이름 아래에서 Settings(설정)를 클릭합니다. "설정" 탭이 표시되지 않으면 드롭다운 메뉴를 선택한 다음 설정을 클릭합니다.

    탭을 보여 주는 리포지토리 헤더의 스크린샷. "설정" 탭이 진한 주황색 윤곽선으로 강조 표시됩니다.

  4. In the left sidebar, click Hooks.

  5. Next to the pre-receive hook that you want to configure, select the Hook permissions dropdown menu, then click whether to enable or disable the pre-receive hook.