Skip to main content
Latest Documentation
This is the latest documentation for the Cloud Posse Reference Architecture. To determine which version you're currently using, please see Version Identification.

GitHub Action: atmos-affected-trigger-spacelift

GitHub Action for Triggering Affected Spacelift Stacks

Introduction

warning

Deprecated. Migrate to Atmos Native CI.

This action is deprecated, along with the rest of the Spacelift integration it depends on. See the migration guide at https://atmos.tools/deprecated/github-actions/atmos-affected-trigger-spacelift for how to move to Atmos Native CI.

This repo contains a GitHub Action that determines the affected Atmos stacks for a PR, then creates a comment on the PR which Spacelift can use to trigger the corresponding stacks via a push policy.

Optionally, you can use the spacectl trigger method, which uses the spacectl CLI to trigger the corresponding spacelift stacks directly rather than via comment/push policy.

Usage

  name: Pull Request
on:
pull_request:
branches: [ 'main' ]
types: [opened, synchronize, reopened, closed, labeled, unlabeled]

jobs:
context:
runs-on: ubuntu-latest
steps:
- name: Atmos Affected Stacks Trigger Spacelift (via comment)
uses: cloudposse/github-action-atmos-affected-trigger-spacelift@main
id: example
with:
atmos-config-path: ./rootfs/usr/local/etc/atmos
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Atmos Affected Stacks Trigger Spacelift (direct)
uses: cloudposse/github-action-atmos-affected-trigger-spacelift@main
id: example
with:
atmos-config-path: ./rootfs/usr/local/etc/atmos
github-token: ${{ secrets.GITHUB_TOKEN }}
trigger-method: spacectl
spacelift-endpoint: https://unicorn.app.spacelift.io
spacelift-api-key-id: ${{ secrets.SPACELIFT_API_KEY_ID }}
spacelift-api-key-secret: ${{ secrets.SPACELIFT_API_KEY_SECRET }}

Inputs

NameDescriptionDefaultRequired
atmos-config-pathA path to the folder where atmos.yaml is located.false
atmos-include-dependentsWhether to include dependents of affected stacks in the outputfalsefalse
atmos-include-settingsInclude the settings section for each affected componentfalsefalse
atmos-include-spacelift-admin-stacksWhether to include the Spacelift admin stacks of affected stackstruefalse
atmos-stackThe stack to operate onfalse
atmos-versionThe version of atmos to install if install-atmos is truelatestfalse
base-refThe base ref to checkout. If not provided, the head default branch is used.N/Afalse
default-branchThe default branch to use for the base ref.${{ github.event.repository.default_branch }}false
deployA flag to indicate if a deployment should be triggered. If false, a preview will be triggered.falsefalse
filter-by-workspace-enabledFilter out stacks where settings.spacelift.workspace_enabled is false. When enabled, only stacks with workspace_enabled not explicitly set to false will be triggered or posted in PR comments.falsefalse
github-tokenA GitHub token for running the spacelift-io/setup-spacectl actionN/Atrue
head-refThe head ref to checkout. If not provided, the head default branch is used.N/Afalse
identityAtmos auth identityfalse
install-atmosWhether to install atmostruefalse
install-jqWhether to install jqfalsefalse
install-spacectlWhether to install spacectltruefalse
jq-forceWhether to force the installation of jqtruefalse
jq-versionThe version of jq to install if install-jq is true1.7false
nested-matrices-countNumber of nested matrices that should be returned as the output (from 1 to 3)2false
skip-atmos-functionsSkip all Atmos functions such as terraform.output in atmos describe affectedfalsefalse
skip-checkoutDisable actions/checkout for head-ref and base-ref. Useful for when the checkout happens in a previous step and file are modified outside of git through other actionsfalsefalse
skip-process-functionsSkip processing Atmos functions in atmos describe affectedfalsefalse
skip-process-templatesSkip processing Atmos templates in atmos describe affectedfalsefalse
spacectl-versionThe version of spacectl to install if install-spacectl is truelatestfalse
spacelift-api-key-idThe SPACELIFT_API_KEY_IDN/Afalse
spacelift-api-key-secretThe SPACELIFT_API_KEY_SECRETN/Afalse
spacelift-endpointThe Spacelift endpoint. For example, https://unicorn.app.spacelift.ioN/Afalse
trigger-methodThe method to use to trigger the Spacelift stack. Valid values are comment and spacectlcommentfalse

Outputs

NameDescription
affectedThe affected stacks
has-affected-stacksWhether there are affected stacks
matrixThe affected stacks as matrix structure suitable for extending matrix size workaround