Skip to main content
Version: 1.7

Actions with webhook triggers

Webhook triggers automatically run security checks in TRON ASOC when specific events occur, for example, immediately after a push (git push) or when you create a merge or pull request in a version control system (VCS).

For a list of supported VCSs and the events that trigger checks, see Webhook triggers.

Create a webhook trigger​

To create a webhook trigger, follow these steps:

  1. Go to Webhook triggers.
  2. Select Add webhook trigger.
  3. In the window that opens, enter the following information:
    • the webhook trigger name;
    • the webhook trigger description;
    • the project for which you’re creating the webhook trigger;
    • the VCS type;
    • the events that trigger the webhook trigger (Push, MR);
    • the webhook trigger scope (layers, security checks).
  4. Select Add webhook trigger.

Create a new webhook trigger

You can also create a webhook trigger from a project. Follow these steps:

  1. Go to Projects.
  2. Select the required project.
  3. Go to the Webhook triggers tab.
  4. Select Add webhook trigger.
  5. Follow step 3 in the preceding instructions.
  6. Select Add webhook trigger.

Create a new webhook trigger from a project

After you select Add webhook trigger, the page displays a modal window with the webhook URL. Add this URL to your VCS settings.

The webhook URL has the following format: https://<your TRON.ASOC URL>/api/v1/webhooks/vcs/<integration ID>?token=<TOKEN>. For <TOKEN>, use the API token you created in TRON.ASOC. For more information about creating an API token, see Create an API token.

URL of the created webhook

danger

The webhook URL is displayed only once after you create the webhook trigger.

The created webhook trigger also appears in the trigger list in Webhook triggers.

Add a webhook trigger to a repository​

To add a webhook trigger to a repository, follow these steps:

  1. Sign in to the VCS (GitHub, GitLab, Bitbucket, and so on) where your repository is located.
  2. In your repository settings, go to Webhooks.
  3. Enter the URL you received when you created the webhook trigger.
  4. Select the application/json content type.
  5. Enter the secret in the signature verification field (Secret/Token).
  6. Select the event types that correspond to those you selected when you created the webhook trigger (push, merge request, pull request, and so on).
  7. Save the webhook.

After you save the webhook, the VCS sends POST requests to the TRON.ASOC endpoint when the specified events occur.

Edit a webhook trigger​

To edit a webhook trigger, follow these steps:

  1. Select the additional actions button next to the required webhook trigger in the Triggers section.
  2. Select Edit.
  3. Edit the webhook trigger information.
  4. Select Save changes.

The webhook trigger information is updated, but the webhook URL remains unchanged.

Delete a webhook trigger​

To delete one webhook trigger, follow these steps:

  1. Select the additional actions button (Additional actions) next to the required webhook trigger.
  2. Select Delete.
  3. In the modal window that opens, confirm the deletion of the webhook trigger.

Webhook trigger deletion confirmation window

The webhook trigger is deleted from the system and no longer appears in the list of webhook triggers in Webhook triggers.

To delete multiple webhook triggers, follow these steps:

  1. Select the required webhook triggers using the checkboxes (Checkbox).
  2. Select the delete button (Delete) above the webhook trigger table.
  3. In the modal window that opens, confirm the deletion of the webhook triggers.

Webhook triggers deletion confirmation window

The webhook triggers are deleted from the system and no longer appear in the list in Webhook triggers.