Back to Skills

ci-cd

verified

CI/CD(GitHub Actions、Screwdriver)の確認方法とトラブルシュート。 推測ではなく、必ずログを確認してから対策を講じる。

View on GitHub

Marketplace

ai-agent-setup

sk8metalme/ai-agent-setup

Plugin

ci-cd-tools

Repository

sk8metalme/ai-agent-setup
1stars

plugins/ci-cd-tools/skills/ci-cd/SKILL.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/sk8metalme/ai-agent-setup/blob/main/plugins/ci-cd-tools/skills/ci-cd/SKILL.md -a claude-code --skill ci-cd

Installation paths:

Claude
.claude/skills/ci-cd/
Powered by add-skill CLI

Instructions

# CI/CD確認スキル

## 目的

CI/CDの失敗時に、**推測で解決するのではなく**、必ずジョブのログを確認して原因を把握してから対策を講じる。

## 重要な原則

### ❌ 禁止事項

- エラーメッセージを見ずに推測で修正を試みる
- ログを部分的にしか確認しない
- エラーの根本原因を特定せずに対症療法を実施

### ✅ 必須事項

- **必ずジョブのログ全体を確認する**
- エラーメッセージの前後のコンテキストを読む
- 失敗したステップを特定する
- 根本原因を理解してから修正する

## GitHub Actionsのログ確認方法

### 1. CLIでワークフロー実行状況を確認

```bash
# 最新のワークフロー実行一覧を表示
gh run list

# 特定のワークフロー実行の詳細を表示
gh run view <run-id>

# 失敗したワークフロー実行のみを表示
gh run list --status failure

# 特定のブランチのワークフロー実行を表示
gh run list --branch feature/my-branch
```

### 2. ジョブのログを取得

```bash
# 特定のワークフロー実行のログを表示
gh run view <run-id> --log

# 失敗したジョブのログのみを表示
gh run view <run-id> --log-failed

# ログをファイルに保存
gh run view <run-id> --log > workflow.log
```

### 3. 特定のジョブのログを確認

```bash
# ジョブ一覧を表示
gh run view <run-id> --job

# 特定のジョブのログを表示
gh run view --job <job-id> --log
```

### 4. Webブラウザで確認

```bash
# ワークフロー実行ページをブラウザで開く
gh run view <run-id> --web
```

### 5. リアルタイムでログを監視

```bash
# ワークフロー実行を監視(ポーリング)
gh run watch <run-id>
```

## Screwdriverのログ確認方法

### 1. Screwdriver CLIでビルド状況を確認

```bash
# ビルド一覧を表示
sd-cmd exec get builds --pipeline <pipeline-id>

# 特定のビルドの詳細を表示
sd-cmd exec get build --build-id <build-id>
```

### 2. ビルドログを取得

```bash
# ビルドログを表示
sd-cmd exec get build-log --build-id <build-id>

# ステップごとのログを確認
sd-cmd exec get build-log --build-id <build-id> --step <step-name>
```

### 3. WebブラウザでScrewdriver UIを確認

```bash
# Screwdriver UIのURLを開く
open https://screwdriver.company.com/pipelines/<pipeline-id>/builds/<build-id>
```

### 4. APIを使用したログ取得

```bash
# curlでビルドログを取得
curl -H "Authorization: Bearer $SD_TOKEN" \
  "https://api.screwdriver.company.com/v4/builds/<build-id>/steps/<step-name>/logs"

# jqで整形
curl -H "Authorization: Bearer $SD_TOKEN" \
  "https://api.screwdriver.company.com/v4/builds/<build-id>/steps/<step-name>/logs" | jq -r '.[].message'
```

## 失敗時の対応フロー

### Step 1: ログを全文確認

```bash
# GitHub Actionsの場合
gh run view <run-id> --log > /tmp/ci-log.txt
cat /tmp/ci-log.txt

# Screwdriverの場合
sd-cmd exec get build-log --bu

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4557 chars