Updated on 2024-11-22 GMT+08:00

Webhook Settings

Configuring Webhook Settings

Developers can configure URLs of third-party systems on the Webhook page and subscribe to events such as branch push and tag push of CodeArts Repo based on project requirements. When a subscription event occurs, you can use a webhook to send a POST request to the URL of a third-party system to trigger operations related to your system (third-party system), such as popping up a notification window, building or updating images, or performing deployment.

To configure webhooks, you can choose Settings > Service Integration > Webhooks on the repository details page.

The settings take effect only for the repository configured. Members within the repo can view this page.

Table 1 Parameters for creating a webhook

Parameter

Description

Name

Custom name.

Description

Description of the webhook.

URL

Mandatory. Provided by the third-party CI/CD system.

Token Type

Used for webhook interface authentication of third-party services. The options are as follows:

  • X-Repo-Token
  • X-Gitlab-Token
  • X-Auth-Token

Token

Used for third-party CI/CD system authentication. The authentication information is stored in the HTTP request header.

Trigger Events

The system can subscribe to the following events:

  • Code push
    • If Code push is selected, Regular Expression for Branch Filtering is displayed.
      NOTE:

      Regular Expression for Branch Filtering: The default value is .*, indicating that all branches are matched. Max. 500 characters.

      The regular expression for branch filtering must comply with the regular expression.

    • This event is triggered when code is updated in CodeArts Repo, such as code update in LFS files or submodules, and code pushed online or on a local Git client.
  • Tag push

    This event is triggered when a tag is created or deleted.

  • Merge requests
    • This event is triggered when a merge request is created.
    • This event is triggered when a merge request is updated. For example, when someone updates the code content, merge request status (closed or re-opened), merge request title or description, merger, and work items, deletes the source branch, and updates the squash.
    • This event is triggered when a request is merged.
  • Comments
    • This event is triggered when a review comment is added. For example, add a review for a file on the Files and Commits submenus of the Code tab page, or on the Files Changed submenu of the Merge Requests tab page.
    • This event is triggered when a comment is added on the Commits details page or on the Details page of Merge Requests tab page.
  • A maximum of 20 webhooks can be created for a repository.
  • You can configure a token when setting up a webhook. The token will be associated with the webhook URL and sent to you in the X-Repo-Token header.