Skip to content

How to access env variable in "contains" arguments #25968

Answered by BrightRan
ma-sadeghi asked this question in Actions
Discussion options

You must be logged in to vote

@ma-sadeghi,

According to the description from the docs about the env context:

You can only use the env context in the value of the with and name keys, or in a step’s if conditional.

You can’t use the env context in a job’s if conditional.
You can directly use the github context in the job’s if conditional.

jobs:
  build:
    . . .
    runs-on: ${{ matrix.operating-system }}
    if: contains(github.event.head_commit.message, 'ci skip')

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants