A 'build' job computes whether a deploy is necessary and sets output 'should_deploy' to 'true' or 'false'. How should the 'deploy' job skip work when the value is 'false'?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Wire needs to access the output, then guard deploy with if: comparing needs.build.outputs.should_deploy. You cannot delete jobs at runtime or use a fictional skip strategy key.
Full explanation below image
Full Explanation
Conditional jobs use if: with the needs context after declaring needs: build. The build job must declare outputs.should_deploy mapped from a step output. Comparing to the string 'true' is important because outputs are strings. There is no runtime YAML mutation API for removing jobs. strategy.skip is not valid. runs-on labels cannot encode skip logic. When the condition is false, the deploy job is skipped, which may cascade to downstream jobs unless their if: handles skipped needs carefully (for example checking needs.build.result). This pattern optimizes CI by avoiding unnecessary deploys when build determines there are no release-worthy changes in the changeset.