Interview Prep/GitHub Actions/Workflow Anatomy & Execution Model

What is the difference between `run` and `uses` in a step?

BeginnerConceptWorkflow Anatomy & Execution Model
Answer

run executes a script in a shell on the runner (bash by default on Linux and macOS, pwsh on Windows). uses invokes an action: from a public repo (actions/checkout@v4), a local path (./.github/actions/setup), or a Docker image (docker://alpine:3.20). A step cannot have both. Inputs to an action go in with:; environment for either goes in env:.

All GitHub Actions questions Roadmap: GitHub Actions

More on Workflow Anatomy & Execution Model