Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP1stack specificStack: yaml
github-actionscicorrectnessworkflow
Use the branch context variable that matches the workflow trigger
In GitHub Actions, github.event.ref is null for pull_request; use github.head_ref (or a fallback) for branch names on PR triggers.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codeyaml
| 1 | with: |
| 2 | branch_name: ${{ github.event.ref }} # null on pull_request |
Explanation (EN)
Objašnjenje (HR)
Good example
New codeyaml
| 1 | with: |
| 2 | branch_name: ${{ github.head_ref || github.ref_name }} |
Explanation (EN)
Objašnjenje (HR)