Skip to content

[step-reference] warning on engine.env that references a step from the agent job (copied into activation secret validation) #75203

Closed

Description

@theletterf

I moved the Elastic Docs workflows to a token minted in the agent job (Google Workload Identity), and gh-aw v1.0.1 now warns about it at compile time. The warning is correct, and I could not find a way to avoid it without breaking the workflow.

The engine key is set from a step that only exists in the agent job:

engine:
  id: claude
  env:
    ANTHROPIC_API_KEY: Bearer ${{ steps.agent-router-auth.outputs.id_token || 'agent-router' }}

gh-aw copies engine.env into two places in the compiled lock file. In the agent job the agent-router-auth step exists, so the key is the minted token. In the activation job, the "Validate ANTHROPIC_API_KEY secret" step gets the same expression, where that step does not exist:

- name: Validate ANTHROPIC_API_KEY secret
  run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh" ANTHROPIC_API_KEY 'Claude Code' ...
  env:
    ANTHROPIC_API_KEY: Bearer ${{ steps.agent-router-auth.outputs.id_token || 'agent-router' }}

At run time this works, because the expression is empty in the activation job and the || 'agent-router' fallback satisfies the non-empty check. v0.92.5 compiled the same source without a warning. v1.0.1 prints:

warning: [step-reference] Step expression references an unknown step; use a step ID declared in the same job at jobs.activation.steps[8].env.ANTHROPIC_API_KEY (script line 0)

The same warning appears for OPENAI_API_KEY on the codex workflows. The lock files are byte-identical in this expression before and after the upgrade, so v1.0.1 only added the check.

I looked for a way to avoid this and found none. Removing the fallback makes the activation validation fail on an empty key. I found no frontmatter option to skip the secret validation or to set engine.env for one job only. The only validation keys in the v1.0.1 schema belong to the memory tools.

Any of these would fix it for me:

  • an option on the engine to skip the activation-job secret validation when the key comes from a step in the agent job
  • an engine.env form that applies to the agent job only
  • no warning when the expression has a || fallback

Minimal reproduction, compiled with gh-aw v1.0.1 (gh aw compile):

---
on:
  workflow_dispatch:
permissions:
  contents: read
  id-token: write
engine:
  id: claude
  env:
    ANTHROPIC_API_KEY: Bearer ${{ steps.my-auth.outputs.token || 'fallback' }}
steps:
  - name: Mint token
    id: my-auth
    run: echo "token=abc" >> "$GITHUB_OUTPUT"
---

# Repro

Say hello.

This prints the [step-reference] warning for jobs.activation.steps[6].env.ANTHROPIC_API_KEY, and the lock file has the expression in both the activation job and the agent job. In my real case the five affected workflows are in elastic/docs-actions#447, for example .github/workflows/gh-aw-issue-triage.md.

Activity

  1. theletterf commented on Nov 5, 2026

    @theletterf
    Author
  2. locked and limited conversation to collaborators on Nov 5, 2026
  3. unlocked this conversation on Nov 5, 2026
  4. locked and limited conversation to collaborators on Nov 5, 2026
  5. unlocked this conversation on Nov 5, 2026
  6. theletterf commented on Nov 6, 2026

    @theletterf
    Author

    Thanks for taking this one up!

  7. locked and limited conversation to collaborators on Nov 6, 2026
  8. unlocked this conversation on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions