Configure Approval Gates Step

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

To enable Approval Gates, add a new section to your step configuration named requiresApproval.

Note

By default, Approval Gates is disabled. To enable it, add the requiresApproval section to your step configuration.

Use the Defaults

To enable Approval Gates and use the default values for a step, add the requiresApproval flag to your step configuration and set it as true.

In this case, the following defaults are applied to the Pending Approval step:

  • approvers: Any user with execute permissions can approve or reject a Pending Approval step.

  • notifications: No notifications are sent.

  • timeoutSeconds: Defaults to 86400 seconds (24 hours), after which the step is canceled automatically.

Example

Approval Gates Configuration with Default Values

pipelines:
  - name: MyApprovalGatesPipeline
    steps:
      - name: approvalGatesStep
        type: Bash
        configuration:
          requiresApproval: true
        execution:
          onExecute:
            - echo "executing step..."

Customize Your Configuration

Alternatively, you can define your own requiresApproval configuration section and define the following:

  • approvers: A list of Artifactory user names that can approve or reject the step.

  • notifications: A list of SMTP and Slack integrations. Based on the configuration, SMTP and Slack notifications are sent when the step goes into Pending Approval status.

  • timeoutSeconds: A window of time, in seconds, in which the approvers can approve or reject the step. If no response is recorded during this timeout period, the step is canceled automatically.

Note

You do not have to include all 3 sections when customizing a step's requiresApproval configuration section. If you do not include one of the sections, this section defaults to the behavior defined above. For example, if you do not provide a configuration for requiresApproval.timeoutSeconds , it defaults to 86400 seconds (24 hours).

Note

  • The first user that responds from the approvers' list determines if the step is approved or rejected.

  • Pipelines Admins can approve or reject the step without being listed on the approvers' list.

  • Artifactory transient users are currently not supported as approvers.

Example

Approval Gates Configuration with Custom Values

pipelines:
  - name: MyApprovalGatesPipeline
    steps:
      - name: approvalGatesStep
        type: Bash
        configuration:
          requiresApproval:
            timeoutSeconds: 43200 # if not approved in this timeframe, the step will be cancelled
            approvers:
              - user1 # must be a valid Artifactory user
              - user2 # must be a valid Artifactory user
            notifications:
              - integrationName: SMTP_Integration # requires SMTP integration
                recipients:
                  - email@example.com
              - integrationName: Slack_Integration # required Slack integration
        execution:
          onExecute:
            - echo "executing step..."