This GitHub Action triggers StackGen's drift detection through the StackGen CLI. It mirrors the structure of the Generate IaC Action.
Please follow the steps below to setup the action:
- Signup for an account on StackGen
- Make an appStack and note the appStack id (part of the URL after /appstacks/)
- Setup a Personal Access Token on StackGen
- Add the PAT as a GitHub secret:
STACKGEN_TOKEN - Add any other necessary cloud provider credentials your appStack requires
| Name | Description | Required |
|---|---|---|
appstack_id |
The ID of the appStack to check | β Yes |
region |
Region for the appStack (e.g. us-east-1) | β Yes |
Create a new workflow under .github/workflows/ in your project:
name: Drift Detection
on:
# Manual trigger
workflow_dispatch:
# Scheduled run every day at 6 AM UTC
schedule:
- cron: '0 6 * * *'
jobs:
drift:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Create temporary directory
run: mkdir -p tmp
- name: Trigger StackGen Drift Detection
uses: AaravAggarwal/stackgen-drift-detection-action@main
env:
STACKGEN_TOKEN: ${{ secrets.STACKGEN_TOKEN }}
TMPDIR: ${{ github.workspace }}/tmp
# Add any cloud provider creds your appStack needs, for example:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
with:
appstack_id: 'your-appstack-id-here' # Found in the URL after /appstacks/
region: 'your-region-here' # e.g. us-east-1