GitHub Action: atmos-affected-trigger-spacelift
GitHub Action for Triggering Affected Spacelift Stacks
Introduction
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 }}