Skip to content

ignore-if-missing generates invalid if: expression using secrets context #44709

Description

@MrSanchez

Hi,

I ran into this issue while setting up gh-aw in my organization, perhaps I am misunderstanding but:

When ignore-if-missing: true is set on safe-outputs.github-app, the compiler seems to generate an if: condition that references secrets:

if: ${{ vars.MYAPP_CLIENT_ID != '' && secrets.MYAPP_PRIVATE_KEY != '' }}

GitHub Actions rejects this at parse time: secrets is not a valid context in if: expressions (only github, needs, vars, env, inputs, steps are allowed).

Error: Unrecognized named-value: 'secrets'. Located at position 31 within expression

Workaround I applied: Remove ignore-if-missing: true. The if: condition is no longer generated and the step runs unconditionally.

Relevant documentation that seems problematic: https://github.github.com/gh-aw/reference/auth/#gracefully-skip-minting-when-keys-are-missing-ignore-if-missing

Versions I experienced this on: gh-aw v0.81.6 and v0.82.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions