Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

managing-pre-receive-hooks-on-the-github-enterprise-server-appliance.md 5.3 KB

You have to be logged in to leave a comment. Sign In
title intro redirect_from versions type topics
Managing pre-receive hooks on the GitHub Enterprise Server appliance Configure how people will use pre-receive hooks within their {% data variables.product.prodname_ghe_server %} appliance. [/enterprise/admin/developer-workflow/managing-pre-receive-hooks-on-the-github-enterprise-server-appliance /enterprise/admin/guides/developer-workflow/managing-pre-receive-hooks-on-the-github-enterprise-appliance/ /enterprise/admin/policies/managing-pre-receive-hooks-on-the-github-enterprise-server-appliance /admin/policies/managing-pre-receive-hooks-on-the-github-enterprise-server-appliance] [{enterprise-server *}] how_to [Enterprise Policies Pre-receive hooks]

Creating pre-receive hooks

{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %} {% data reusables.enterprise-accounts.hooks-tab %} 4. Click Add pre-receive hook. Add pre-receive hook 5. In the Hook name field, enter the name of the hook that you want to create. Name pre-receive hook 6. From the Environment drop-down menu, select the environment on which you want the hook to run. Hook environment 7. Under Script, from the Select hook repository drop-down menu, select the repository that contains your pre-receive hook script. From the Select file drop-down menu, select the filename of the pre-receive hook script. Hook script 8. Select Use the exit-status to accept or reject pushes to enforce your script. Unselecting 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. Use exit-status 9. Select Enable this pre-receive hook on all repositories by default if you want the pre-receive hook to run on all repositories. Enable hook all repositories 10. Select Administrators can enable and disable this hook to allow organization members with admin or owner permissions to select whether they wish to enable or disable this pre-receive hook. Admins enable or disable hook

Editing pre-receive hooks

{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %} {% data reusables.enterprise-accounts.hooks-tab %}

  1. Next to the pre-receive hook that you want to edit, click {% octicon "pencil" aria-label="The edit icon" %}. Edit pre-receive

Deleting pre-receive hooks

{% data reusables.enterprise-accounts.access-enterprise %} {% data reusables.enterprise-accounts.settings-tab %} {% data reusables.enterprise-accounts.hooks-tab %} 2. Next to the pre-receive hook that you want to delete, click {% octicon "x" aria-label="X symbol" %}. Edit pre-receive

Configure pre-receive hooks for an organization

An organization administrator 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 administrator or owner.

{% data reusables.profile.access_org %} {% data reusables.profile.org_settings %} 4. In the left sidebar, click Hooks. Hooks sidebar 5. Next to the pre-receive hook that you want to configure, click the Hook permissions drop-down menu. Select whether to enable or disable the pre-receive hook, or allow it to be configured by the repository administrators. Hook permissions

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.

{% data reusables.profile.enterprise_access_profile %} 2. Click Repositories and select which repository you want to configure pre-receive hooks for. Repositories {% data reusables.repositories.sidebar-settings %} 4. In the left sidebar, click Hooks & Services. Hooks and services 5. Next to the pre-receive hook that you want to configure, click the Hook permissions drop-down menu. Select whether to enable or disable the pre-receive hook. Repository hook permissions

Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...