Skip to content

feat: vars context support in callback inputs #34

Description

@joshua-temple

Problem

The promote workflow resolves inputs and env_inputs into JSON matrix literals during generation. Only three ${{ matrix.* }} substitutions are applied (promote.go:168–315, in resolveDeployInputs and writeMatrixBuildingLogic). A manifest value like ${{ vars.DEPLOY_BUCKET }} or ${{ secrets.API_KEY }} is written as a literal string into the matrix JSON and arrives at the callback as a dead, uninterpolated expression.

The orchestrate path is also unverified: generator.go:589–623 carries environment/sha/dep outputs through with:, but ${{ vars.X }} values in operator-authored with: entries may not survive the passthrough correctly.

The consequence is that per-environment config must live in the manifest as literals rather than in GitHub's Environment Variables settings — where operators actually manage it and where the environment-protection gates (planned separately) control access.

What to add

Document and enforce a clean rule: manifest inputs/env_inputs values that look like GHA expression syntax (${{ ... }}) must be passed through to the emitted with: block verbatim, without literal resolution into the matrix JSON.

On the promote path, values that are pure expressions (the entire value is ${{ ... }}) should remain as expression strings in the matrix payload, allowing GHA's own runtime to evaluate them when the called workflow runs.

Schema sketch:

No new field is required. The change is in the emit semantics: resolveDeployInputs should detect expression-syntax values and skip literal resolution for them, emitting the expression as-is.

A doc/validation note clarifying which expression contexts are valid in inputs values (e.g. ${{ vars.X }}, ${{ matrix.environment }}, ${{ github.sha }}) is part of this work.

Acceptance criteria

  • A manifest env_inputs value of ${{ vars.BUCKET }} is emitted verbatim in the callback with: block, not as the literal string ${{ vars.BUCKET }} trapped inside a JSON string inside a matrix literal.
  • ${{ matrix.environment }} and other matrix substitutions continue to work as before.
  • cascade validate warns when a non-expression literal value in inputs contains characters that suggest the operator may have intended an expression (e.g. a bare vars.X without ${{ }}).
  • Existing manifests using literal string values are unaffected.
  • e2e scenario: a manifest with env_inputs: {bucket: "${{ vars.DEPLOY_BUCKET }}"} generates a promote workflow where the deploy callback's with.bucket is ${{ vars.DEPLOY_BUCKET }}; a GitHub Actions dry-run on a repo with DEPLOY_BUCKET=my-bucket in Environment Variables resolves it correctly at runtime.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions