I have the following workflow:
env:
CHANNEL: ${{ fromJSON('["testing", "stable"]')[github.ref_type == 'tag' && startsWith(github.ref_name, 'v')] }}
jobs:
build:
...
promote_package:
if: github.ref == 'refs/heads/master' || env.CHANNEL == 'stable'
needs: build
...
Unfortunately, the above is invalid as it seems I can't use env.CHANNEL
in the condition expression for a job :-( How to make it work?