本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)33k · #8764

github-workflow-automation

できること

このスキルは、コードの変更のレビューや新しい課題の振り分けなど、AIの助けを借りてGitHubを自動化するパターンを示します。リポジトリでの手作業を減らしたい開発者に向けたものです。

使う場面

  • ✓新しいプルリクエストをAIが自動でレビューするようにしたいとき。
  • ✓届いたGitHubの課題を自動で振り分けたり、ラベルを付けたりしたいとき。
  • ✓GitHub Actionsのパイプラインに、AIの処理を追加したいとき。

スキルのリンク

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/github-workflow-automation/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/github-workflow-automation/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のGitHubリポジトリで、新しいプルリクエストごとにAIの自動レビューが動くように設定してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、サンプルのワークフローファイルを提供します。各ファイルは、プルリクエストや課題の変更を集め、AIモデルに送り、結果をGitHubに投稿し直します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

🔧 GitHub Workflow Automation

Patterns for automating GitHub workflows with AI assistance, inspired by Gemini CLI and modern DevOps practices.

When to Use This Skill

Use this skill when:

  • Automating PR reviews with AI
  • Setting up issue triage automation
  • Creating GitHub Actions workflows
  • Integrating AI into CI/CD pipelines
  • Automating Git operations (rebases, cherry-picks)

1. Automated PR Review

1.1 PR Review Action

# .github/workflows/ai-review.yml
name: AI Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Get changed files
        id: changed
        run: |
          files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
          echo "files<<EOF" >> $GITHUB_OUTPUT
          echo "$files" >> $GITHUB_OUTPUT
          echo "EOF" >> $GITHUB_OUTPUT

      - name: Get diff
        id: diff
        run: |
          diff=$(git diff origin/${{ github.base_ref }}...HEAD)
          echo "diff<<EOF" >> $GITHUB_OUTPUT
          echo "$diff" >> $GITHUB_OUTPUT
          echo "EOF" >> $GITHUB_OUTPUT

      - name: AI Review
        uses: actions/github-script@v7
        with:
          script: |
            const { Anthropic } = require('@anthropic-ai/sdk');
            const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });

            const response = await client.messages.create({
              model: "claude-sonnet-4-6",
              max_tokens: 4096,
              messages: [{
                role: "user",
                content: `Review this PR diff and provide feedback:
                
                Changed files: ${{ steps.changed.outputs.files }}
                
                Diff:
                ${{ steps.diff.outputs.diff }}
                
                Provide:
                1. Summary of changes
                2. Potential issues or bugs
                3. Suggestions for improvement
                4. Security concerns if any
                
                Format as GitHub markdown.`
              }]
            });

            await github.rest.pulls.createReview({
              owner: context.repo.owner,
              repo: context.repo.repo,
              pull_number: context.issue.number,
              body: response.content[0].text,
              event: 'COMMENT'
            });
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

1.2 Review Comment Patterns

# AI Review Structure

## 📋 Summary

Brief description of what this PR does.

## ✅ What looks good

- Well-structured code
- Good test coverage
- Clear naming conventions

## ⚠️ Potential Issues

1. **Line 42**: Possible null pointer exception
   ```javascript
   // Current
   user.profile.name;
   // Suggested
   user?.profile?.name ?? "Unknown";
   ```
  1. Line 78: Consider error handling
    // Add try-catch or .catch()
    

💡 Suggestions

  • Consider extracting the validation logic into a separate function
  • Add JSDoc comments for public methods

🔒 Security Notes

  • No sensitive data exposure detected
  • API key handling looks correct

### 1.3 Focused Reviews

```yaml
# Review only specific file types
- name: Filter code files
  run: |
    files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | \
            grep -E '\.(ts|tsx|js|jsx|py|go)$' || true)
    echo "code_files=$files" >> $GITHUB_OUTPUT

# Review with context
- name: AI Review with context
  run: |
    # Include relevant context files
    context=""
    for file in ${{ steps.changed.outputs.files }}; do
      if [[ -f "$file" ]]; then
        context+="=== $file ===\n$(cat $file)\n\n"
      fi
    done

    # Send to AI with full file context

2. Issue Triage Automation

2.1 Auto-label Issues

# .github/workflows/issue-triage.yml
name: Issue Triage

on:
  issues:
    types: [opened]

jobs:
  triage:
    runs-on: ubuntu-latest
    permissions:
      issues: write

    steps:
      - name: Analyze issue
        uses: actions/github-script@v7
        with:
          script: |
            const issue = context.payload.issue;

            // Call AI to analyze
            const analysis = await analyzeIssue(issue.title, i
よくある質問

YAMLファイルを書く必要がありますか?

はい。例はYAMLのワークフローファイルで、リポジトリに追加して使います。

git作業も手伝えますか?

はい。リベースやチェリーピックの自動化も扱います。

どのステップを選べますか?

例では各ステップが個別に示されているため、必要なものを選べます。

詳細

作者による元の説明

Automate GitHub workflows with AI assistance. Includes PR reviews, issue triage, CI/CD integration, and Git operations. Use when automating GitHub workflows, setting up PR review automation, creating GitHub Actions, or triaging issues.

repo: davila7/claude-code-templates

人気

GitHubのスター
33k
ランキング
#8764
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル