Context
I want to check in my workflow if a secret is present or not before executing a job.
Something like this:
publish:
runs-on: ubuntu-latest
if: secrets.AWS_ACCESS_KEY_ID != ''
steps:
[ ... ]
However, I've got an error like this when using this expression:
The workflow is not valid. .github/workflows/release.yml (Line: 11, Col: 9): Unrecognized named-value: 'secrets'...
What I tried
I tried to wrote the expression another way:
if: ${{ secrets.AWS_ACCESS_KEY_ID != '' }}
if: ${{ secrets.AWS_ACCESS_KEY_ID }} != ''
Question
How to achieve what I want in a Github Actions workflow?