C.W.K.
Stream
Lesson 08 of 13 · published

Workflow 디버깅

~10 min · debug, logs, runner-debug

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

디버그 툴킷

  1. 디버그 로깅으로 재실행 — 실패 run 의 UI 버튼; 또는 repo secret 으로 ACTIONS_RUNNER_DEBUG=true + ACTIONS_STEP_DEBUG=true 설정. 로그가 5-10× 길어지지만 모든 API 호출 봄.
  2. Step 디버그 actionmxschmitt/action-tmate 가 job 중간에 runner 에 SSH 세션 염. 유용 (그리고 위험 — 세션 보는 누구나 secret 훔침).
  3. Step Summary — 실패 step 안에서 $GITHUB_STEP_SUMMARY 에 진단 정보 추가.
  4. Artifact dump — 실패 관련 파일 (log, 스크린샷, env dump) 을 if: always() 로 업로드 — 다운로드하고 검사 가능.
  5. 로컬 재현 — 같은 image, 같은 env, act 또는 그냥 Docker.

흔한 버그와 그걸 드러내는 것

  • Step 이 예상치 못하게 skipif: expression 확인; act 가 해석 값 출력.
  • Secret 이 비어 보임 → scope 안에 없음 (org / env 불일치) 또는 fork PR.
  • Cache 절대 복원 안 됨 → key 불일치; 디버그로 실행해서 해석 key 문자열 봄.
  • Matrix 가 job 안 생산 → 빈 fromJSON 입력; upstream job 의 output 확인.
  • Self-hosted runner 가 안 가져감 → label 불일치, runner offline, 또는 runner busy.

Code

실패 시 항상 업로드되는 진단 번들·yaml
      - name: Run e2e
        run: ./tests/e2e.sh
      - name: Diagnostic bundle
        if: always()
        run: |
          mkdir -p diag
          cp -r logs/ diag/
          docker compose logs > diag/compose.log 2>&1 || true
          env | sort | grep -v -i 'TOKEN\|KEY\|SECRET' > diag/env.log
      - if: always()
        uses: actions/upload-artifact@v4
        with:
          name: diag-${{ github.run_id }}-${{ github.run_attempt }}
          path: diag/
          retention-days: 7

External links

Exercise

지난 달 실패한 workflow 골라. 디버그 로깅으로 재실행하고 해석된 expression / API 호출 읽어. 이전에 없던 정보 최소 하나 발견.

Progress

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

댓글 0

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

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