C.W.K.
Stream
Lesson 04 of 12 · published

Step

~11 min · steps, run, uses

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Step 은 한 runner 에서 순차

Job 안에서 step 들은 같은 runner 에서 차례로 돔. Step 사이 filesystem 이 유지돼. Step 실패 → job 실패 (continue-on-error 없으면).

Step 은 둘 중 하나야:

  1. run: step — shell 명령 실행. 기본 shell: Linux/macOS 는 bash, Windows 는 pwsh.
  2. uses: step — 재사용 가능한 action 호출. 형식: uses: org/repo@ref.

흔한 step 필드

  • name — 친근한 이름 (log 에 표시). 옵션이지만 친절해.
  • id — 내부 id (나중 step 에서 이 step 의 output 참조용).
  • if — expression 으로 step 막음.
  • env — step 범위 env var.
  • working-directory — step 시작 디렉토리.
  • shell — 기본 shell 덮어쓰기.
  • continue-on-error — step 실패해도 job 안 실패.
  • timeout-minutes — N 분 후 step kill.
  • withuses: action 의 input map.

Code

흔한 step 모양들·yaml
steps:
  # uses: invoke an action
  - uses: actions/checkout@v4
    with:
      fetch-depth: 0

  # uses + with: pin runtime version
  - uses: actions/setup-python@v5
    with:
      python-version: '3.12'

  # run: shell command
  - name: Install
    run: |
      python -m pip install --upgrade pip
      pip install -r requirements.txt

  # run + id: capture output for later steps
  - name: Get short SHA
    id: sha
    run: echo "sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT

  - name: Use captured output
    run: echo 'short SHA was ${{ steps.sha.outputs.sha }}'

External links

Exercise

Step 5 개 가진 job 짜: checkout, setup-node, install, lint, test. 각 step 에 name: 달아. 여섯 번째 step 은 github.event_name == 'pull_request' 일 때만 도는 걸로 추가: echo 'this is a PR build'.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.