A teammate wrote this workflow, and every run fails:
yaml
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: ./test.shEach job gets a fresh machine. It has tools (git, bash, shellcheck), but none of your code: ./test.sh isn't there until something copies it over.
An action is a ready-made step, used by name with uses:. GitHub's actions/checkout copies the commit being tested onto the machine. Make it the first step:
yaml
steps:
- uses: actions/checkout@v7 # ← first: the code
- run: ./test.sh # ← then the tests@v7 is the version of the action you want: GitHub needs one.
Objectives
- What does the log say about
./test.sh? - Check out the code first, and get a green run.