Cicd Github Actionsのロゴ

Cicd Github Actions

コミュニティ
d-padmanabhan
cicd-github-actions

GitHub Actions best practices for CI/CD workflows. Covers security (permissions, secrets), performance (caching, matrix builds), reusable workflows, and common patterns for testing, building, and deploying. Use when working with .github/workflows/*.yml files, GitHub Actions, or when asking about CI/CD pipelines and automation.

概要

公開者d-padmanabhan
リポジトリagent-engineering-handbook
スキル名cicd-github-actions
スター
20
フォーク
3
同梱ファイル
6
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 6個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    d-padmanabhanがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Cicd Github Actions」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/cicd-github-actions
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook.git /tmp/agent-engineering-handbook
mkdir -p .claude/skills
cp -r /tmp/agent-engineering-handbook/skills/cicd-github-actions .claude/skills/cicd-github-actions
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCicd Github Actionsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にCicd Github Actionsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Cicd Github Actionsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

GitHub Actions CI/CD

Core Objectives

  • Security: Minimal permissions, secrets handling, OIDC
  • Performance: Caching, matrix builds, parallelization
  • Maintainability: Reusable workflows, composite actions
  • Reliability: Concurrency control, retry logic

Essential Checklist

  • Workflows use minimal permissions (permissions: {} at root)
  • Secrets never logged or exposed in artifacts
  • Concurrency control configured
  • Timeout values set on all jobs
  • Caching implemented for dependencies
  • PR workflows use pull_request, not pull_request_target
  • A bordered operational header follows the workflow name:
  • Untrusted contexts and inputs reach shell commands through step-level env
  • Production deploys use protected GitHub Environments
  • Changed workflows pass actionlint

Workflow Authoring Contract

Put a bordered operational comment block immediately after the workflow name. Use the headings Purpose, Triggers, Required Secrets, and Dependencies, with blank comment lines between sections. Record approval, rollback, recovery, or runbook requirements under Dependencies.

yaml
name: Deploy Application

# ================================================================
# Purpose: Deploys a tested release to a protected environment
#
# Triggers:
#   - Manual workflow dispatch
#
# Required Secrets:
#   - None: cloud authentication uses OIDC
#
# Dependencies:
#   - Published release artifact
#   - Production GitHub Environment approval
#   - Rollback runbook: docs/deployment-rollback.md
# ================================================================

Document reusable workflow and action inputs, outputs, secrets, defaults, and side effects where they are declared. Give jobs and non-obvious steps descriptive names, but do not add comments that merely restate YAML. Keep secret values, sensitive identifiers, and production data out of comments, summaries, logs, and artifacts.

Use the workflow documentation reference for the complete header pattern, interface descriptions, comments, summaries, and review checklist.

Treat ${{ github.event.* }}, ${{ inputs.* }}, issue text, branch names, and action outputs as untrusted data. Do not interpolate them directly into a run: script. Assign them to step-level env, quote the shell variable, and validate constrained values before use. See Security.

For a complete starting point and local validation commands, use the minimum viable workflow.

Minimal Permissions

yaml
name: CI

# ================================================================
# Purpose: Runs bounded validation for main and pull requests
#
# Triggers:
#   - Push to main
#   - Pull requests targeting main
#
# Required Secrets:
#   - None
#
# Dependencies:
#   - Repository lockfile and test configuration
# ================================================================

on:
  push:
    branches: [main]
  pull_request:

# Default: no permissions
permissions: {}

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    timeout-minutes: 30
    # Job-level permissions
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: '20'
      - run: npm ci
      - run: npm test

Caching

yaml
- uses: actions/setup-node@v7
  with:
    node-version: '20'
    cache: 'npm'

# Or explicit caching
- uses: actions/cache@v6
  with:
    path: ~/.npm
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-node-

Matrix Builds

yaml
jobs:
  test:
    name: Test Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
    runs-on: ubuntu-latest
    timeout-minutes: 30
    permissions:
      contents: read
    strategy:
      fail-fast: false
      matrix:
        node-version: [18, 20, 22]
        os: [ubuntu-latest, macos-latest]
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm ci
      - run: npm test

Concurrency Control

yaml
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

Secrets Handling

yaml
steps:
  - name: Use secret safely
    env:
      API_KEY: ${{ secrets.API_KEY }}
    run: |
      set -euo pipefail
      curl --fail --silent --show-error \
        -H "Authorization: Bearer ${API_KEY}" \
        https://api.acme.com

Reusable Workflows

yaml
# .github/workflows/reusable-build.yml
name: Reusable Build

# ================================================================
# Purpose: Builds and tests one supported Node.js version for a caller
#
# Triggers:
#   - Reusable workflow call
#
# Required Secrets:
#   - NPM_TOKEN: required only for private dependencies
#
# Dependencies:
#   - Caller supplies a supported Node.js version
# ================================================================

on:
  workflow_call:
    inputs:
      node-version:
        description: Supported Node.js version to build and test.
        required: false
        type: string
        default: '20'
    secrets:
      NPM_TOKEN:
        description: Registry token required only for private dependencies.
        required: false

permissions: {}

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: ${{ inputs.node-version }}
      - run: npm ci
      - run: npm run build
yaml
# Calling workflow
jobs:
  build:
    uses: ./.github/workflows/reusable-build.yml
    with:
      node-version: '20'
    secrets:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Job Outputs

yaml
jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      version: ${{ steps.version.outputs.value }}
    steps:
      - id: version
        run: echo "value=$(cat VERSION)" >> "$GITHUB_OUTPUT"

  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Report version
        env:
          VERSION: ${{ needs.build.outputs.version }}
        run: printf 'Deploying %s\n' "$VERSION"

Action-Version Audit

Before changing workflow logic, audit every uses: reference. By default, query the latest stable GitHub release, derive its major alias, verify that the upstream publishes the alias, and use that alias. If the user explicitly requests an exact stable tag or immutable commit SHA, verify and use the requested pinning mode instead.

bash
action="OWNER/REPO"
latest_tag="$(gh api "repos/${action}/releases/latest" --jq '.tag_name')"
if [[ "${latest_tag}" =~ ^v([0-9]+)(\.[0-9]+){1,2}$ ]]; then
  major_tag="v${BASH_REMATCH[1]}"
else
  printf 'Unsupported stable release tag: %s\n' "${latest_tag}" >&2
  exit 1
fi
gh api "repos/${action}/git/ref/tags/${major_tag}" --silent
printf 'uses: %s@%s # latest stable: %s\n' "${action}" "${major_tag}" "${latest_tag}"

Decision matrix per finding:

Pin stateAction
Verified latest stable major aliasRetain after compatibility review
Exact stable tag or immutable SHA explicitly requested by the userVerify and retain the requested pinning mode
Older major, older exact tag, @main, @master, @latest, unpinned, or invented aliasReplace with the verified latest stable major alias unless the user requested another verified mode
Archived, missing, prerelease-only, or no verifiable stable release or major aliasStop and report; do not silently downgrade or replace

Major aliases and release tags are mutable Git references. Restrict workflows to reviewed actions, read release provenance and notes, preserve independently revertible upgrades, run actionlint, and let Dependabot or Renovate propose future updates. Follow the GitHub Actions rule (${HANDBOOK_ROOT}/rules/160-github-actions.mdc) and dependency currency workflow (${HANDBOOK_ROOT}/skills/core-engineering/references/dependency-and-toolchain-currency.md).

Detailed References

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Cicd Github Actions」では何ができますか?

GitHub Actions best practices for CI/CD workflows. Covers security (permissions, secrets), performance (caching, matrix builds), reusable workflows, and common patterns for testing, building, and deploying. Use when working with .github/workflows/*.yml files, GitHub Actions, or when asking about CI/CD pipelines and automation.

TypingMindでCicd Github Actionsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Cicd Github Actionsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCicd Github Actionsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/cicd-github-actionsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Cicd Github Actionsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Cicd Github Actionsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCicd Github Actionsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Cicd Github Actions」は無料ですか?

はい。d-padmanabhanがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇