Skip to content

Feature Request: job.<job id>.on #25571

Answered by BradenM
AlanKuurstra asked this question in Actions
Discussion options

You must be logged in to vote

Hi @alankuurstra!

This is actually currently possible using jobs.<job id>.if conditional with the github.ref context item.

Here is an example:

jobs:
  job1:
    steps:
      - run: echo "I always execute!"
  job2:
    if: github.ref == 'refs/heads/master'
    steps:
      - run: echo "I only execute on master branch!"
job3:
if: contains(github.ref, 'release')
steps:
- run: echo "I only run if the pushed branch contains 'release' in its name!

Replies: 2 comments

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
Labels
None yet
2 participants