| 
1 |  | -# stackgen-action  | 
 | 1 | +# Stackgen CLI GitHub Action  | 
 | 2 | + | 
 | 3 | +This action allows you to run Stackgen CLI commands in your GitHub workflows.  | 
 | 4 | + | 
 | 5 | +## Inputs  | 
 | 6 | + | 
 | 7 | +### Required Inputs  | 
 | 8 | + | 
 | 9 | +- `command`: The main stackgen command to run (appstack, provision, destroy, etc)  | 
 | 10 | + | 
 | 11 | +### Optional Inputs  | 
 | 12 | + | 
 | 13 | +- `subcommand`: Subcommand for the main command (if applicable)  | 
 | 14 | +- `flags`: Command flags as a multi-line string, one flag per line  | 
 | 15 | +- `aws_access_key`: AWS Access Key for authentication  | 
 | 16 | +- `aws_secret_key`: AWS Secret Key for authentication  | 
 | 17 | +- `aws_region`: AWS Region  | 
 | 18 | + | 
 | 19 | +## Example Usage  | 
 | 20 | + | 
 | 21 | +```yaml  | 
 | 22 | +- uses: your-org/stackgen-action@v1  | 
 | 23 | +  with:  | 
 | 24 | +    command: 'provision'  | 
 | 25 | +    flags: |  | 
 | 26 | +      --appstack-id my-stack-id  | 
 | 27 | +      --apply  | 
 | 28 | +      --work-dir ./infrastructure  | 
 | 29 | +      --log 3  | 
 | 30 | +      --output human  | 
 | 31 | +      --var environment=production  | 
 | 32 | +      --var region=us-west-2  | 
 | 33 | +      --backend-config bucket=my-terraform-state  | 
 | 34 | +    aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}  | 
 | 35 | +    aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}  | 
 | 36 | +    aws_region: 'us-west-2'  | 
 | 37 | +```  | 
 | 38 | +
  | 
 | 39 | +## Advanced Usage - Multiple Commands  | 
 | 40 | +
  | 
 | 41 | +```yaml  | 
 | 42 | +jobs:  | 
 | 43 | +  deploy:  | 
 | 44 | +    runs-on: ubuntu-latest  | 
 | 45 | +    steps:  | 
 | 46 | +      - uses: actions/checkout@v2  | 
 | 47 | +        | 
 | 48 | +      - name: Generate Infrastructure  | 
 | 49 | +        uses: your-org/stackgen-action@v1  | 
 | 50 | +        with:  | 
 | 51 | +          command: 'generate'  | 
 | 52 | +          flags: |  | 
 | 53 | +            --work-dir ./infrastructure  | 
 | 54 | +            | 
 | 55 | +      - name: Provision Infrastructure  | 
 | 56 | +        uses: your-org/stackgen-action@v1  | 
 | 57 | +        with:  | 
 | 58 | +          command: 'provision'  | 
 | 59 | +          flags: |  | 
 | 60 | +            --apply  | 
 | 61 | +            --work-dir ./infrastructure  | 
 | 62 | +          aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}  | 
 | 63 | +          aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}  | 
 | 64 | +```  | 
 | 65 | +
  | 
 | 66 | +Each flag in the `flags` input should be on a new line, including its value if applicable. This provides a more straightforward and readable way to pass command-line arguments to the Stackgen CLI.  | 
0 commit comments