0

I have a GitHub Action that can be triggered via the GitHub UI (with workflow_dispatch), which has a boolean flag as one of the inputs.

What I want to do is this - set a condition in post-if that is evaluated to true only if the user-provided flag is set to true.

I tried to write it like this, but it didn't work:

post-if: "${{ github.event.inputs.cache }}"

I got the following error in CI:

Unrecognized named-value: 'github'. Located at position 1 within expression: github.event.inputs.cache

Is this doable? Or can event inputs simply not be used in post-if?

Paul Razvan Berg
  • 16,949
  • 9
  • 76
  • 114

1 Answers1

0

Yup, looks like this is doable.

I just had to delete the braces {{ }}:

post-if: "github.event.inputs.cache"
Paul Razvan Berg
  • 16,949
  • 9
  • 76
  • 114