CI/CD(GitHub Actions、Screwdriver)の確認方法とトラブルシュート。 推測ではなく、必ずログを確認してから対策を講じる。
/plugin marketplace add sk8metalme/ai-agent-setup/plugin install ci-cd-tools@ai-agent-setupThis skill is limited to using the following tools:
CI/CDの失敗時に、推測で解決するのではなく、必ずジョブのログを確認して原因を把握してから対策を講じる。
# 最新のワークフロー実行一覧を表示
gh run list
# 特定のワークフロー実行の詳細を表示
gh run view <run-id>
# 失敗したワークフロー実行のみを表示
gh run list --status failure
# 特定のブランチのワークフロー実行を表示
gh run list --branch feature/my-branch
# 特定のワークフロー実行のログを表示
gh run view <run-id> --log
# 失敗したジョブのログのみを表示
gh run view <run-id> --log-failed
# ログをファイルに保存
gh run view <run-id> --log > workflow.log
# ジョブ一覧を表示
gh run view <run-id> --job
# 特定のジョブのログを表示
gh run view --job <job-id> --log
# ワークフロー実行ページをブラウザで開く
gh run view <run-id> --web
# ワークフロー実行を監視(ポーリング)
gh run watch <run-id>
# ビルド一覧を表示
sd-cmd exec get builds --pipeline <pipeline-id>
# 特定のビルドの詳細を表示
sd-cmd exec get build --build-id <build-id>
# ビルドログを表示
sd-cmd exec get build-log --build-id <build-id>
# ステップごとのログを確認
sd-cmd exec get build-log --build-id <build-id> --step <step-name>
# Screwdriver UIのURLを開く
open https://screwdriver.company.com/pipelines/<pipeline-id>/builds/<build-id>
# 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'
# GitHub Actionsの場合
gh run view <run-id> --log > /tmp/ci-log.txt
cat /tmp/ci-log.txt
# Screwdriverの場合
sd-cmd exec get build-log --build-id <build-id> > /tmp/sd-log.txt
cat /tmp/sd-log.txt
Error:, FAILED:, ✗, [ERROR] を検索# エラー行を抽出
grep -i "error\|failed\|✗" /tmp/ci-log.txt
# 前後5行のコンテキストも表示
grep -i -B 5 -A 5 "error" /tmp/ci-log.txt
以下の観点で分析:
根本原因を理解してから、以下を実施:
# 最新のワークフロー実行を確認
gh run list --limit 1
# 成功を確認
gh run view <run-id>
Error: Process completed with exit code 1確認すべき点:
対処法:
# ログ全体を確認してエラー箇所を特定
gh run view <run-id> --log | grep -B 20 "exit code 1"
Error: Unable to resolve action確認すべき点:
対処法:
# 正しいアクション名を確認
- uses: actions/checkout@v4 # v3 → v4 に更新
Error: Resource not accessible by integration確認すべき点:
GITHUB_TOKEN の権限設定permissions セクション対処法:
permissions:
contents: write
pull-requests: write
Build failed: Command not found確認すべき点:
対処法:
# screwdriver.yamlでイメージを確認
image: node:18 # 必要なコマンドが含まれるイメージを使用
Build timeout確認すべき点:
対処法:
# タイムアウトを延長
annotations:
screwdriver.cd/timeout: 120 # 分単位
Secrets not found確認すべき点:
対処法:
# Screwdriver UIでシークレットを確認
# Pipeline Settings > Secrets
重要: このスキルの最も重要な原則は「推測せず、ログを確認する」ことです。必ずログ全体を読んでから対策を講じてください。
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.