-
🔰 fundamental topics for beginners getting started with DevSensei
-
🔬 advanced topics for once you have your first workflows automated
List of available actions that fuel your automation.
Let us know if you miss an action.
add-reviewers action since 8.8
Suggests and/or adds reviewers to a pull request. (See also add-watchers for watchers instead)
|
Action option |
Definition |
|---|---|
|
|
Decides which users are selected to be added as reviewers. Choice 1: requires Code Owners custom attribute to be defined. Members will be resolved according to the rules applied to the overall diff of the PR. YAML
Choice 2: identifier list Identifiers are either a user slug, an email address or a group reference (either to a custom group, or to a Bitbucket group). Group references are resolved transitively to all members of the group. YAML
|
|
|
number limit the number of reviewers that can be assigned to a pull request. This feature is useful to prevent unwanted notifications in the case of manipulation mistakes (e.g., creating a Pull Request from the wrong branch, or an unhappy rebase) YAML
|
|
|
reduce the number of reviewers that are automatically assigned to a pull request. Currently, the only available method of assignment is at random. YAML
|
|
|
choice from
YAML
|
add-watchers action since 8.8
Adds watchers to a pull request. (See also add-reviewers for reviewers instead)
|
Action option |
Definition |
|---|---|
|
|
Decides which users are selected to be added as watchers. Choice 1: requires Code Owners custom attribute to be defined. Members will be resolved according to the rules applied to the overall diff of the PR. YAML
Choice 2: identifier list Identifiers are either a user slug, an email address or a group reference (either to a custom group, or to a Bitbucket group). Group references are resolved transitively to all members of the group. YAML
|
unapprove action since 8.5
Unapprove all or some of the approved reviews in the Pull Request.
|
Action option |
Definition |
|---|---|
|
|
Decides which users are selected to be unapproved. Choice 1: unapprove all users who are currently reviewers. YAML
Choice 2: requires Code Owners custom attribute to be defined. Members will be resolved according to the rules applied to the diff of the most recent change to the PR. YAML
Choice 3: identifier list Identifiers are either a user slug, an email address or a group reference (either to a custom group, or to a Bitbucket group). Group references are resolved transitively to all members of the group. YAML
|
add-comment action since 8.2
Adds a single comment or task to a pull request. Can either be custom content, or automated reporting of action results.
See also the add-checklist action below for more flexibility
|
Action option |
Definition |
|---|---|
|
|
( YAML
|
|
|
( YAML
DevSensei will use a builtin formatter to report the results of the action in a readable format. For now: 💡only |
|
|
( YAML
|
add-checklist action since 9.1.0
Adds a complete checklist of tasks and comments to a pull-request.
|
Action option |
Definition |
|---|---|
|
|
( YAML
|
|
|
( An item can be a Comment or a Task.
YAML
|
|
|
( Options are:
YAML
|
decline action since 8.11
Declines the pull request, adding a comment for justification.
|
Action option |
Definition |
|---|---|
|
|
Required, specifies the reason for declining the pull request. It may contain template splices. |
Use case
This action can be used together with the Age attribute to automatically decline old pull requests.
workflows:
- name: Declines old pull requests
conditions:
- age > duration('7 days')
actions:
- decline:
comment: Declined because it stayed open for one week.
suggest-description action since 8.11
Suggests a pull request title and/or description on the Create Pull Request page.
This action does not modify an existing pull request. It only provides suggestions to the user when creating a pull request.
|
Action option |
Definition |
|---|---|
|
|
( YAML
|
|
|
( YAML
|
At least one of title or description must be configured.
autofill-placeholders action since 8.11
Automatically expands ${…​} placeholders in the pull request title and/or description.
Typical use case: you create pull requests via REST API, or users want to write a custom expression in the description. DevSensei will replace these placeholders with their concrete values.
|
Action option |
Definition |
|---|---|
|
|
( YAML
|
|
|
Definition |
|---|---|
|
|
When actions are triggered, update the pull request if valid placeholders are present in the title/description. 💡 Configure YAML
|
schedule-auto-merge action since 8.3
Schedules this pull request to be automatically merged once all merge checks are clear.
schedule-auto-merge shares some functionality with the Auto Merge DevSensei feature, however the features operate independently.
If your repository uses branch permissions to prevent all changes on a branch, then the schedule-auto-merge action will only work with the merge-as-author: true flag.
|
Action option |
Definition |
|---|---|
|
|
Optional, possible values: Merge strategy used for the pull request. When not specified, the default merge strategy of the repository will be used. Strategy must be allowed by the repository configuration. YAML
|
|
|
Optional ( YAML
|
|
|
Optional ( YAML
|
|
|
Optional ( YAML
|
|
|
Optional ( |
Prerequisites
This action requires:
-
Bitbucket 8.15 or newer
-
The Bitbucket Auto-Merge feature must be enabled for the repository
Auto-Merge Behavior
When the action runs, it submits an Auto-Merge for this pull request. Bitbucket then will merge the pull request, depending on its state:
|
Pull Request State |
What Bitbucket Does |
|---|---|
|
Pull request is mergeable |
Immediately merges it |
|
Merge checks are failing |
Merges as soon as merge checks pass |
|
Merge conflict is present |
No Auto Merge Request is submitted |
|
A commit changes/new commits added while pull request is open |
Auto Merge status is cancelled, and DevSensei will not re-submit a Auto Merge Request until the workflow is retriggered. |
Check the Bitbucket documentation for more details on how auto merge behaves.
Because the Auto-Merge request may be cancelled by new commits, you may decide to ask again for auto-merging. See the Retrigger On section for more details
Auto-Merge Use Cases
The schedule-auto-merge action makes it simpler to automatically accept lower risk pull requests by merging quickly. As it is based on Bitbucket’s Auto Merge feature, after scheduling, Bitbucket will still prevent merge if there is a veto from one of the merge checks enabled for your repository (for example anything in the merge-checks section).
|
Use Case |
Example Workflow |
|---|---|
|
Fast track code based on a |
YAML
|
|
Fast track code based if build succeed and is from a trusted bot-author, e.g. one that only submits library dependency updates. |
YAML
|
|
Merge when the developer requests to skip reviewers, for example by adding a You can also achieve this using the DevSensei Auto Merge feature, which has the benefit of an interactive graphical user interface, and when skipping is requested it automatically removes the "Codeowners minimum approvals" merge check. Alternatively, instead of checking the |
YAML
|
|
Merge when a PR is without conflicts and not in a draft state. |
YAML
|
|
Merge when a required number of approvals is met (Equivalent to SHIP/SHOW/ASK). |
YAML
|
Other Auto-Merge Use Cases (Planned)
The following ideas rely upon planned or otherwise unimplemented features. Contact support to let us know your use case.
-
Schedule merge when a no reviewer requested changes. (requires new attribute)
-
Wait until another PR has been merged (e.g. merge queue)
-
Check total size of change is within a small range (requires a new attribute).
add-codeowners action since 7.0 deprecated
This action is now deprecated and divided into several smaller, more regular, features. See actions add-reviewers and unapprove, and merge check codeowners-check.
Adds Code Owners as reviewers to a pull request.
|
Action option |
Definition |
|---|---|
|
|
number limit the number of Code Owners that can be assigned to a pull request. (opt-in) This feature is useful to prevent unwanted notifications in the case of manipulation mistakes (e.g., creating a Pull Request from the wrong branch, or an unhappy rebase) YAML
|
|
|
reduce the number of Code Owners that are automatically assigned to a pull request. (opt-in) Currently, the only available method of assignment is at random. YAML
|
|
|
The Code Owners rules and merge checks. For existing YAML
|
|
|
Define custom Code Owners groups. YAML
|
|
|
Remove approval if owned code changes. YAML
|
cancel-auto-merge action (Planned)
Cancels any pending auto merge. This action is planned. Contact support to let us know your use case.