integrations/github-action/stack. It installs levelrail-cli, runs stack plan on pull requests and stack apply on the protected branch. A full workflow is in integrations/github-action/stack/example-workflow.yml, and the shorter copy block is on IaC in CI.
What it does
Set
version to a release tag such as v1.2.0. Do not rely on latest: the Action warns when you do.
Sign in
Pick one:- GitHub OIDC (no stored secret). Set
oidc: "true", give the jobid-token: write, and setoidc-audienceto the dashboard URL when it differs fromapi-url. Register what each workflow may do withlevelrail-cli stack trust add. See Tokens in CI. - Token secret. Pass
tokenfrom a repository secret for the plan job and an environment secret for the apply job.
Exit codes as outputs
Theexit-code output carries what the CLI returned. The step fails only on an error.
Other outputs:
has-changes, plan-hash, revision, status, expires_at.
The sticky comment
Withcomment: "true" and pull-requests: write, the plan step posts one comment per stack and updates it on every push. It only edits a comment posted by github-actions[bot] that carries its hidden marker, so a planted marker is ignored. The comment is capped by comment-max-chars (default 60000): a longer plan is cut with a pointer to the job summary, which always holds the full text. Secret values never appear in the comment, only secret names inside the plan.
Apply the reviewed plan
Run plan and apply with the samesecrets list, then pass the plan hash to apply so a change in live state after review is refused:
environment: production with required reviewers as the approval gate. For separate plan and apply workflows, the inputs and recipes are in integrations/github-action/stack/README.md.
Next: IaC in CI, Stacks and GitOps.