What is the difference between 'uses:' and 'run:' in a workflow step?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Think of 'uses:' as calling a function from a library, while 'run:' is writing the function inline yourself.
Full explanation below image
Full Explanation
'uses:' references an action — either from the GitHub Marketplace (owner/repo@version), a local path, or a Docker image. It packages reusable logic. 'run:' executes one or more shell commands directly on the runner using the default shell (bash on Linux/macOS, powershell on Windows). A step can use either 'uses:' or 'run:', but not both. They are not equivalent; 'uses:' invokes pre-built actions with their own logic, while 'run:' gives direct shell access.