Create a Code Automation Trigger

How to create your first CodeSee Code Automation Trigger

📘

Code Automations are a Business or Enterprise feature only.

To create a new Code Automation Trigger, navigate to the Automate home page and click "Add Trigger".

You'll be presented with a form to set up your new Trigger. After choosing a descriptive name, you'll be prompted to choose the target repository from a list. This cannot be changed after the Trigger is created.

Conditions

Next up, you will set up conditions, which are a list of criteria that determine when a Trigger should execute.

We currently support 3 conditions (with more coming soon): "File name", "File path", and "File added in folder".

📘

A file path is different from a file name

For example: src/app/index.ts is a file path, while index.ts is a file name.

File name condition

This condition matches against the name of files in your repository.

File path condition

This condition matches against the name of files in your repository.

File added in folder condition

This condition matches when files are added to a specific folder in a pull request.

For example, the filter "File added in folder" with the operator "folder path equals" with the value "src/components/icons" would match any file that was added in that icons folder.

An example condition that applies to files added in a folderAn example condition that applies to files added in a folder

An example condition that applies to files added in a folder

Previewing

Use the "Preview" panel on the right to verify the conditions of your Automation.

Note: when previewing the "File added in folder" condition, the Preview panel will show existing files, but note that your Trigger will only execute when new files are added to the matching folders.

Actions

Today, 4 kinds of actions are currently supported (with more coming soon): posting a comment, adding a checklist item, assigning a pull request, and assigning a reviewer.

Add a comment to a pull request

When this action is executed, CodeSee will post the comment on the matching pull request.

Add a checklist item to a pull request

When this action is executed, CodeSee will add a new checklist item to the PR description. You can add as many checklist items as you need by adding an action for each item.

Assign a pull request to someone

When this action is executed, CodeSee will assign the pull request to the GitHub user of your choice. If you'd like to assign multiple users, you can create multiple instances of this action on the same Trigger.

If you supply an optional message to explain why this user is being assigned, CodeSee will post a comment notifying that user and explaining why they were assigned.

Assign someone as a reviewer

When this action is executed, CodeSee will assign the person or team of your choice as a reviewer on the PR. If you'd like to add multiple reviewers, you can create multiple instances of this action on the same Trigger.

If you supply an optional message to explain why this user is being assigned as a reviewer, CodeSee will post a comment notifying that user and explaining why they were assigned as a reviewer.

Note: a pull request can never have the author of the pull request as a reviewer. If an action would cause the author to be a reviewer on their own pull request, CodeSee will skip over that action, but still perform all other actions on the trigger.

Example

An example of actions defined on a TriggerAn example of actions defined on a Trigger

An example of actions defined on a Trigger


Did this page help you?