I have a GitHub pipeline.
I want to run a step conditionally.
I'm running on fix_bug
branch
My code:
- name: Run Step
if: ${{ contains(github.ref, 'bug_fix') || github.ref == 'fix_bug' }}
run: |
Excepted result:
Should run the step (or enter into the step).
Actual result:
Doesn't enter into the step.
The step has the didn't run sign.
Using
if: ${{ contains(github.ref, 'bug_fix') || github.ref == 'refs/heads/fix_bug' }}
resolved the issue, but anyone know to tell why I should the prefix refs/heads
?
Tnx