NFTT-GitHub-Workflowsの実践的な使用パターンを紹介します。プロジェクトの規模や目的に応じて、最適なパターンを選択してください。
# 方法1: インストールスクリプト
curl -fsSL https://raw.githubusercontent.com/NFTTechnology/NFTT-GitHub-Workflows/main/install.sh | bash
# 方法2: GitHub CLI Extension
gh extension install NFTTechnology/NFTT-GitHub-Workflows --force
gh nftt-workflows install
# .github/workflows/setup-nftt.yml
name: Setup NFTT Workflows
on:
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install NFTT Workflows
run: |
curl -fsSL https://raw.githubusercontent.com/NFTTechnology/NFTT-GitHub-Workflows/main/install.sh | bash -s -- --non-interactive --version v5
FROM ubuntu:latest
RUN apt-get update && apt-get install -y curl git
RUN curl -fsSL https://raw.githubusercontent.com/NFTTechnology/NFTT-GitHub-Workflows/main/install.sh -o /tmp/install.sh && \
chmod +x /tmp/install.sh && \
/tmp/install.sh --non-interactive
# .github/workflows/simple-3ai.yml
name: 3AI Analysis (Small Team)
on:
issue_comment:
types: [created]
jobs:
analyze:
if: |
startsWith(github.event.comment.body, '/analyze') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER')
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
issue_title: $
issue_body: $
repository: $
# v5使用でコスト最適化
version: "v5"
secrets: inherit
# .github/workflows/medium-3ai.yml
name: 3AI Analysis (Medium Team)
on:
issue_comment:
types: [created]
issues:
types: [opened, labeled]
jobs:
analyze-comment:
if: startsWith(github.event.comment.body, '/analyze')
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
issue_title: $
issue_body: $
repository: $
secrets: inherit
analyze-critical:
if: |
github.event_name == 'issues' &&
contains(github.event.issue.labels.*.name, 'critical')
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
issue_title: $
issue_body: $
repository: $
# 重要なIssueはv4で詳細分析
version: "v4"
secrets: inherit
# .github/workflows/enterprise-3ai.yml
name: 3AI Analysis (Enterprise)
on:
issue_comment:
types: [created]
workflow_dispatch:
inputs:
issue_numbers:
description: 'Issue numbers to analyze (comma-separated)'
required: true
ai_models:
description: 'AI models to use'
required: false
default: 'all'
type: choice
options:
- all
- claude-only
- gpt-only
- gemini-only
jobs:
check-permissions:
runs-on: ubuntu-latest
outputs:
allowed: $
steps:
- id: check
uses: actions/github-script@v7
with:
script: |
const teams = ['reviewers', 'maintainers'];
const membership = await github.rest.teams.getMembershipForUserInOrg({
org: context.repo.owner,
team_slug: teams[0],
username: context.actor
});
return membership.status === 200;
analyze:
needs: check-permissions
if: needs.check-permissions.outputs.allowed == 'true'
strategy:
matrix:
issue: $
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
ai_models: $
secrets: inherit
name: Bug Impact Analysis
on:
issues:
types: [labeled]
jobs:
analyze-bug:
if: contains(github.event.issue.labels.*.name, 'bug')
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
issue_title: $
issue_body: $
repository: $
# カスタムプロンプト
custom_prompt: |
このバグの影響範囲を分析してください:
1. 影響を受けるコンポーネント
2. ユーザーへの影響度
3. 修正の緊急度
4. 推奨される修正アプローチ
secrets: inherit
name: Feature Proposal Evaluation
on:
issues:
types: [labeled]
jobs:
evaluate-feature:
if: contains(github.event.issue.labels.*.name, 'enhancement')
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
issue_title: $
issue_body: $
repository: $
version: "v4" # コメント履歴も含めて評価
custom_prompt: |
この機能提案を評価してください:
1. 技術的実現可能性
2. 既存機能との整合性
3. 実装工数の見積もり
4. 潜在的なリスク
secrets: inherit
name: Security Vulnerability Analysis
on:
issues:
types: [labeled]
jobs:
analyze-security:
if: contains(github.event.issue.labels.*.name, 'security')
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
issue_title: $
issue_body: $
repository: $
# セキュリティ分析に特化
custom_prompt: |
セキュリティの観点から分析してください:
1. 脆弱性の深刻度(CVSS)
2. 攻撃ベクトル
3. 影響範囲
4. 緊急対応策
5. 根本的な修正方法
# プライベートコメントで結果を投稿
private_comment: true
secrets: inherit
name: 3AI with Slack Notification
on:
issue_comment:
types: [created]
jobs:
analyze:
if: startsWith(github.event.comment.body, '/analyze')
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
issue_title: $
issue_body: $
repository: $
secrets: inherit
notify:
needs: analyze
if: always()
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: 8398a7/action-slack@v3
with:
status: $
text: |
3AI分析完了
Issue: #$
結果: $
env:
SLACK_WEBHOOK_URL: $
name: Comprehensive Review
on:
pull_request:
types: [opened, synchronize]
jobs:
# 関連Issueの分析
analyze-linked-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
id: get-issues
with:
script: |
const pr = context.payload.pull_request;
const body = pr.body || '';
const issueRefs = body.match(/#(\d+)/g) || [];
return issueRefs.map(ref => ref.substring(1));
- name: Analyze Issues
if: steps.get-issues.outputs.result != '[]'
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_numbers: $
secrets: inherit
# PRのコードレビュー
pr-review:
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-pr-review.yml@main
with:
pr_number: $
secrets: inherit
name: Custom AI Configuration
on:
workflow_dispatch:
inputs:
issue_number:
required: true
jobs:
custom-analysis:
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
# AI個別設定
claude_config: |
model: claude-3-opus-20240229
max_tokens: 4000
temperature: 0.3
openai_config: |
model: gpt-4-turbo-preview
max_tokens: 3000
temperature: 0.5
gemini_config: |
model: gemini-pro
max_output_tokens: 2048
temperature: 0.4
secrets: inherit
name: Multilingual Analysis
on:
issue_comment:
types: [created]
jobs:
detect-language:
runs-on: ubuntu-latest
outputs:
language: $
steps:
- id: detect
uses: actions/github-script@v7
with:
script: |
// 簡易的な言語検出
const body = context.payload.issue.body;
if (/[\u3040-\u309F\u30A0-\u30FF]/.test(body)) return 'ja';
if (/[\u4E00-\u9FAF]/.test(body)) return 'zh';
return 'en';
analyze:
needs: detect-language
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
language: $
custom_prompt: |
言語: $
この言語で分析結果を提供してください。
secrets: inherit
name: Parallel Analysis
on:
schedule:
- cron: '0 2 * * *' # 毎日深夜2時
jobs:
get-issues:
runs-on: ubuntu-latest
outputs:
matrix: $
steps:
- uses: actions/github-script@v7
id: set-matrix
with:
script: |
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: 'needs-analysis',
state: 'open',
per_page: 20
});
return { issues: issues.data.map(i => i.number) };
analyze:
needs: get-issues
strategy:
matrix: $
max-parallel: 3 # 同時実行数を制限
uses: NFTTechnology/NFTT-GitHub-Workflows/.github/workflows/reusable-3ai-issue-analyzer.yml@main
with:
issue_number: $
secrets: inherit
最終更新: 2025年7月