GitHub Action: atmos-affected-stacks
A GitHub Action to get a list of affected atmos stacks for a pull request
Introduction
This is a GitHub Action to get a list of affected atmos stacks for a pull request. It optionally installs
atmos
, terraform
and jq
and runs atmos describe affected
to get the list of affected stacks. It provides the
raw list of affected stacks as an output as well as a matrix that can be used further in GitHub action jobs.
Usage
name: github-action-atmos-affected-stacks
on:
pull_request:
branches: [ 'main' ]
types: [opened, synchronize, reopened, closed, labeled, unlabeled]
jobs:
context:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- id: affected
uses: cloudposse/github-action-atmos-affected-[email protected]/initial-implementation
outputs:
affected: ${{ steps.affected.outputs.affected }}
matrix: ${{ steps.affected.outputs.matrix }}
Inputs
Name | Description | Default | Required |
---|---|---|---|
atmos-version | The version of atmos to install if install-atmos is true | latest | false |
default-branch | The default branch to use for the base ref. | ${{ github.event.repository.default_branch }} | false |
head-ref | The head ref to checkout. If not provided, the head default branch is used. | N/A | false |
install-atmos | Whether to install atmos | true | false |
install-jq | Whether to install jq | false | false |
install-terraform | Whether to install terraform | 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 |
terraform-version | The version of terraform to install if install-terraform is true | latest | false |
Outputs
Name | Description |
---|---|
affected | The affected stacks |
has-affected-stacks | Whether there are affected stacks |
matrix | A matrix suitable for use for GitHub Actions of the affected stacks |