Skip to main content

GA-B006: Missing conditional on PR workflow

Info Best Practice

Why This Matters

In workflows triggered only by `pull_request` or `pull_request_target`, per-job conditionals can prevent unnecessary work (e.g., skip deployment on draft PRs). Only flagged when the workflow has 2+ jobs.

How to Fix

Add an if: conditional to each job

Before (incorrect)

jobs:
  deploy:
    runs-on: ubuntu-latest

After (correct)

jobs:
  deploy:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest

Rule Details

Rule Code
GA-B006
Severity
Info
Category
Best Practice

Related Rules