Spacelift
PrivacyT&Cs
  • 👋Hello, Spacelift!
  • 🚀Getting Started
  • 🌠Main concepts
    • Stack
      • Creating a stack
      • Stack settings
      • Organizing stacks
      • Stack locking
      • Drift detection
    • Configuration
      • Environment
      • Context
      • Runtime configuration
        • YAML reference
    • Run
      • Task
      • Proposed run (preview)
      • Tracked run (deployment)
      • Module test case
      • User-Provided Metadata
      • Run Promotion
      • Pull Request Comments
    • Policy
      • Login policy
      • Access policy
      • Approval policy
      • Initialization policy
      • Plan policy
      • Push policy
      • Task policy
      • Trigger policy
    • Resources
    • Worker pools
    • VCS Agent Pools
  • 🛰️Platforms
    • Terraform
      • Module registry
      • External modules
      • Provider
      • State management
      • Terragrunt
      • Version management
      • Handling .tfvars
      • CLI Configuration
      • Cost Estimation
      • Resource Sanitization
      • Storing Complex Variables
      • Debugging Guide
    • Pulumi
      • Getting started
        • C#
        • Go
        • JavaScript
        • Python
      • State management
      • Version management
    • CloudFormation
      • Getting Started
      • Reference
      • Integrating with SAM
      • Integrating with the serverless framework
    • Kubernetes
      • Getting Started
      • Authenticating
      • Custom Resources
      • Helm
      • Kustomize
  • ⚙️Integrations
    • Audit trail
    • Cloud Integrations
      • Amazon Web Services (AWS)
      • Microsoft Azure
      • Google Cloud Platform (GCP)
    • Source Control
      • GitHub
      • GitLab
      • Azure DevOps
      • Bitbucket Cloud
      • Bitbucket Datacenter/Server
    • Docker
    • GraphQL API
    • Single sign-on
      • GitLab OIDC Setup Guide
      • Okta OIDC Setup Guide
      • OneLogin OIDC Setup Guide
      • Azure AD OIDC Setup Guide
      • AWS IAM Identity SAML 2.0 Setup Guide
    • Slack
    • Webhooks
  • 📖Product
    • Privacy
    • Security
    • Support
      • Statement of Support
    • Disaster Continuity
    • Billing
      • Stripe
      • AWS Marketplace
    • Terms and conditions
    • Refund Policy
  • Cookie Policy
Powered by GitBook
On this page
  • What is supported?
  • Pull Request Plan Commenting
  • Pull Request Comment-Driven Actions

Was this helpful?

  1. Main concepts
  2. Run

Pull Request Comments

Describes Spacelift's support for commenting on pull requests, as well as for taking action due to comments on pull requests

PreviousRun PromotionNextPolicy

Last updated 2 years ago

Was this helpful?

What is supported?

    • Posting the output of the plan as a comment on your pull request.

    • Taking some action within Spacelift based upon a comment on your pull request.

Pull Request Plan Commenting

To enable this feature, simply add the label feature:add_plan_pr_comment to the stacks you wish to have plan commenting enabled for on pull requests.

Once enabled, on any future pull request activity, the result of the plan will be commented onto the pull request.

Pull Request Comment-Driven Actions

To enable support for pull request comment events in Spacelift, you will need to ensure the following permissions are enabled within your VCS app integration. Note that if your VCS integration was created using the Spacelift VCS setup wizard, then these permissions have already been setup automatically, and no action is needed.

  • Read access to issues repository permissions

  • Subscribe to issues:comments event

Assuming the above permissions are configured on your VCS application, you can then access pull request comment event data from within your Push policy, and build customizable workflows using this data.

Please note that Spacelift will only evaluate comments that begin with/spacelift to prevent users from unintended actions against their resources managed by Spacelift. Furthermore, Spacelift only processes event data for new comments, and will not receive event data for edited or deleted comments.

Example policy to trigger a tracked run from a pull request comment event:

package spacelift

track {
    input.pull_request.action == "commented"
    input.pull_request.comment == concat(" ", ["/spacelift", "deploy", input.stack.id])
}

Using a policy such as the example above, a user could trigger a tracked run on their Spacelift stack by commenting something such as:

/spacelift deploy my-stack-id
🌠
Pull Request Plan Commenting
Pull Request Comment-Driven Actions