Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
steps:
- uses: nick-fields/assert-action@v2
with:
expected: '[{"component":"test","component_type":"terraform","component_path":"tests/components/terraform/test","stack":"test-t-test","stack_slug":"test-t-test-test","affected":"stack.vars","affected_all":["stack.vars"],"dependents":null,"included_in_dependents":false,"settings":null}]'
expected: '[{"component":"test","component_type":"terraform","component_path":"components/terraform/test","stack":"test-t-test","stack_slug":"test-t-test-test","affected":"stack.vars","affected_all":["stack.vars"],"dependents":null,"included_in_dependents":false,"settings":null}]'
actual: "${{ needs.test.outputs.affected }}"

- uses: nick-fields/assert-action@v2
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
**
** This file was automatically generated by the `cloudposse/build-harness`.
** 1) Make all changes to `README.yaml`
** 2) Run `make init` (you only need to do this once)
** 3) Run`make readme` to rebuild this file.
** 2) Install [atmos](https://atmos.tools/install/) (you only need to do this once)
** 3) Run`atmos readme` to rebuild this file.
**
** (We maintain HUNDREDS of open source projects. This is how we maintain our sanity.)
**
Expand Down Expand Up @@ -89,18 +89,27 @@ spacelift stacks directly rather than via comment/push policy.
| Name | Description | Default | Required |
|------|-------------|---------|----------|
| atmos-config-path | A path to the folder where atmos.yaml is located | . | false |
| atmos-include-dependents | Whether to include dependents of affected stacks in the output | false | false |
| atmos-include-settings | Include the settings section for each affected component | false | false |
| atmos-include-spacelift-admin-stacks | Whether to include the Spacelift admin stacks of affected stacks | true | false |
| atmos-stack | The stack to operate on | | false |
| atmos-version | The version of atmos to install if install-atmos is true | latest | false |
| base-ref | The base ref to checkout. If not provided, the head default branch is used. | N/A | false |
| default-branch | The default branch to use for the base ref. | ${{ github.event.repository.default\_branch }} | false |
| deploy | A flag to indicate if a deployment should be triggered. If false, a preview will be triggered. | false | false |
| github-token | A GitHub token for running the spacelift-io/setup-spacectl action | N/A | true |
| head-ref | The head ref to checkout. If not provided, the head default branch is used. | N/A | false |
| identity | Atmos auth identity | | false |
| install-atmos | Whether to install atmos | true | false |
| install-jq | Whether to install jq | false | false |
| install-spacectl | Whether to install spacectl | true | false |
| jq-force | Whether to force the installation of jq | true | false |
| jq-version | The version of jq to install if install-jq is true | 1.6 | false |
| jq-version | The version of jq to install if install-jq is true | 1.7 | false |
| nested-matrices-count | Number of nested matrices that should be returned as the output (from 1 to 3) | 2 | false |
| skip-atmos-functions | Skip all Atmos functions such as terraform.output in `atmos describe affected` | false | false |
| skip-checkout | Disable 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 actions | false | false |
| skip-process-functions | Skip processing Atmos functions in `atmos describe affected` | false | false |
| skip-process-templates | Skip processing Atmos templates in `atmos describe affected` | false | false |
| spacectl-version | The version of spacectl to install if install-spacectl is true | latest | false |
| spacelift-api-key-id | The SPACELIFT\_API\_KEY\_ID | N/A | false |
| spacelift-api-key-secret | The SPACELIFT\_API\_KEY\_SECRET | N/A | false |
Expand All @@ -115,6 +124,7 @@ spacelift stacks directly rather than via comment/push policy.
|------|-------------|
| affected | The affected stacks |
| has-affected-stacks | Whether there are affected stacks |
| matrix | The affected stacks as matrix structure suitable for extending matrix size workaround |
<!-- markdownlint-restore -->


Expand Down Expand Up @@ -210,7 +220,7 @@ All other trademarks referenced herein are the property of their respective owne


---
Copyright © 2017-2025 [Cloud Posse, LLC](https://cpco.io/copyright)
Copyright © 2017-2026 [Cloud Posse, LLC](https://cpco.io/copyright)


<a href="https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/github-action-atmos-affected-trigger-spacelift&utm_content=readme_footer_link"><img alt="README footer" src="https://cloudposse.com/readme/footer/img"/></a>
Expand Down
66 changes: 56 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ inputs:
default: latest
description: The version of atmos to install if install-atmos is true
required: false
atmos-include-spacelift-admin-stacks:
description: "Whether to include the Spacelift admin stacks of affected stacks"
required: false
default: "true"
atmos-include-dependents:
description: "Whether to include dependents of affected stacks in the output"
required: false
default: "false"
atmos-include-settings:
description: "Include the settings section for each affected component"
required: false
default: "false"
atmos-stack:
description: "The stack to operate on"
required: false
default: ""
base-ref:
description: "The base ref to checkout. If not provided, the head default branch is used."
required: false
default-branch:
default: ${{ github.event.repository.default_branch }}
description: The default branch to use for the base ref.
Expand All @@ -30,6 +49,10 @@ inputs:
head-ref:
description: The head ref to checkout. If not provided, the head default branch is used.
required: false
identity:
description: "Atmos auth identity"
required: false
default: ""
install-atmos:
default: 'true'
description: Whether to install atmos
Expand All @@ -47,9 +70,25 @@ inputs:
description: Whether to force the installation of jq
required: false
jq-version:
default: '1.6'
default: '1.7'
description: The version of jq to install if install-jq is true
required: false
nested-matrices-count:
description: "Number of nested matrices that should be returned as the output (from 1 to 3)"
required: false
default: "2"
skip-atmos-functions:
description: "Skip all Atmos functions such as terraform.output in `atmos describe affected`"
required: false
default: "false"
skip-process-functions:
description: "Skip processing Atmos functions in `atmos describe affected`"
required: false
default: "false"
skip-process-templates:
description: "Skip processing Atmos templates in `atmos describe affected`"
required: false
default: "false"
spacectl-version:
default: latest
description: The version of spacectl to install if install-spacectl is true
Expand All @@ -67,17 +106,16 @@ inputs:
default: 'comment'
description: The method to use to trigger the Spacelift stack. Valid values are `comment` and `spacectl`
required: false
skip-atmos-functions:
required: false
description: "Skip all Atmos functions such as terraform.output in `atmos describe affected`"
default: "false"
outputs:
affected:
description: The affected stacks
value: ${{ steps.affected-stacks.outputs.affected }}
has-affected-stacks:
description: Whether there are affected stacks
value: ${{ steps.affected-stacks.outputs.has-affected-stacks }}
matrix:
description: The affected stacks as matrix structure suitable for extending matrix size workaround
value: ${{ steps.affected-stacks.outputs.matrix }}

runs:
using: "composite"
Expand All @@ -90,17 +128,25 @@ runs:
id: affected-stacks
uses: cloudposse/github-action-atmos-affected-stacks@v6
with:
atmos-config-path: ${{inputs.atmos-config-path}}
atmos-include-dependents: ${{inputs.atmos-include-dependents}}
atmos-include-settings: ${{inputs.atmos-include-settings}}
atmos-include-spacelift-admin-stacks: ${{inputs.atmos-include-spacelift-admin-stacks}}
atmos-stack: ${{inputs.atmos-stack}}
atmos-version: ${{inputs.atmos-version}}
base-ref: ${{inputs.base-ref}}
default-branch: ${{inputs.default-branch}}
head-ref: ${{inputs.head-ref}}
identity: ${{inputs.identity}}
install-atmos: ${{inputs.install-atmos}}
atmos-version: ${{inputs.atmos-version}}
atmos-config-path: ${{inputs.atmos-config-path}}
atmos-include-spacelift-admin-stacks: "true"
install-jq: ${{inputs.install-jq}}
jq-version: ${{inputs.jq-version}}
jq-force: ${{inputs.jq-force}}
jq-version: ${{inputs.jq-version}}
nested-matrices-count: ${{inputs.nested-matrices-count}}
process-functions: ${{ inputs.skip-process-functions != 'true' }}
process-templates: ${{ inputs.skip-process-templates != 'true' }}
skip-atmos-functions: ${{inputs.skip-atmos-functions}}
skip-checkout: ${{ inputs.skip-checkout }}
skip-checkout: ${{inputs.skip-checkout}}

- name: Setup Spacectl
if: ${{ steps.affected-stacks.outputs.has-affected-stacks == 'true' && inputs.install-spacectl == 'true' && inputs.trigger-method == 'spacectl' }}
Expand Down
2 changes: 1 addition & 1 deletion tests/atmos.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
base_path: "./tests"
base_path: "."

components:
terraform:
Expand Down