해당 안 되는 작업 skip
Job 과 step 둘 다 if: expression 지원. Expression 이 truthy / falsy 평가; falsy 면 skip.
흔한 패턴:
- Branch 별:
if: github.ref == 'refs/heads/main' - Tag 별:
if: startsWith(github.ref, 'refs/tags/v') - Event 별:
if: github.event_name == 'push' - Label 별:
if: contains(github.event.pull_request.labels.*.name, 'deploy') - Path 별: 대신 workflow level
paths:필터 써. - 상태 별:
if: failure(),if: cancelled(),if: always()
Skipped vs failed
False 평가되는 if: 는 failed 아니라 skipped 생성. Skipped job 은 workflow 실패 안 시켜. Branch protection 활성화면 required status check 도 만족 안 시킴 — required check 를 조건 뒤에 gate 하지 마, 안 그러면 feature branch PR 이 hang.