0

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?

Mateusz Pusz
  • 1,363
  • 1
  • 9
  • 16
  • Possible duplicate of https://stackoverflow.com/questions/75844035/github-action-how-to-reference-env-variable-in-the-job-and-step-if-condition. – Azeem Mar 30 '23 at 12:04

0 Answers0