Skip to main content

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

NameDescriptionDefaultRequired
atmos-versionThe version of atmos to install if install-atmos is truelatestfalse
default-branchThe default branch to use for the base ref.${{ github.event.repository.default_branch }}false
head-refThe head ref to checkout. If not provided, the head default branch is used.N/Afalse
install-atmosWhether to install atmostruefalse
install-jqWhether to install jqfalsefalse
install-terraformWhether to install terraformtruefalse
jq-forceWhether to force the installation of jqtruefalse
jq-versionThe version of jq to install if install-jq is true1.6false
terraform-versionThe version of terraform to install if install-terraform is truelatestfalse

Outputs

NameDescription
affectedThe affected stacks
has-affected-stacksWhether there are affected stacks
matrixA matrix suitable for use for GitHub Actions of the affected stacks