Problem Statement
You only want deployments to run on the main branch. What should your pipeline config do?
Explanation
Guard deploy steps with rules. Build and test can run everywhere, but deployment should gate on main or release branches.
This prevents accidental production pushes.
Code Solution
SolutionRead Only
if: github.ref == 'refs/heads/main' steps: - run: ./deploy.sh
