> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/pr-torirsunogtingu/cli-for-pr-and-release-gating/github-action-setup-for-aikido-cli-release-gating.md).

# Aikido CLI: リリースゲーティング向け GitHub Actions 設定

Aikido Security CI クライアントを使用すると、Aikido Security のスキャンを CI パイプラインに統合できます。これにより、セキュリティスキャンをビルドプロセスの一部に含められます。

## 1. API トークンを取得する <a href="#id-1-get-api-token" id="id-1-get-api-token"></a>

1. 次へ移動します： [継続的インテグレーション設定ページ](https://app.aikido.dev/settings/integrations/continuous-integration).
2. トークンを生成してコピーします。このトークンは一度しか表示できないことに注意してください。
3. このトークンを次の名前で保存します *AIKIDO\_CLIENT\_API\_KEY* GitHub Secrets の Settings > Secrets and variables > Actions に移動して設定します。

## 2. 新しい GitHub Actions ワークフローを作成する <a href="#id-2-create-a-new-github-action-workflow" id="id-2-create-a-new-github-action-workflow"></a>

この例を使用してワークフローファイルを作成します：

> ローカルスキャナーがデフォルトブランチでのみトリガーされるようにしてください。以下の例では 'main' ブランチです。必要に応じて調整してください。

```
name: Aikido リリースゲートスキャン
on:
  push:
    branches:
      - main

jobs:
  aikido-scan:
    runs-on: ubuntu-latest

    steps:
      # ステップ 1: Node.js をセットアップ
      - name: Node.js をセットアップ
        uses: actions/setup-node@v3
        with:
          node-version: '22'

      # ステップ 2: 依存関係をインストール
      - name: Aikido CI API クライアントをインストール
        run: npm install --global @aikidosec/ci-api-client

      # ステップ 3: Aikido Scan Release を実行
      - name: Aikido スキャンを実行
        run: aikido-api-client scan-release ${{ github.event.repository.name }} $GITHUB_SHA --apikey ${{ secrets.AIKIDO_CLIENT_API_KEY }} --fail-on-sast-scan --fail-on-iac-scan --fail-on-secrets-scan
```

必要に応じてコマンドを調整してください。すべてのオプションは次の場所で確認できます [こちら](https://www.npmjs.com/package/@aikidosec/ci-api-client).

## 3. 最初のスキャンを実行する <a href="#id-3-run-your-first-scan" id="id-3-run-your-first-scan"></a>

デフォルトブランチに新しい変更がプッシュされると、ワークフローがトリガーされます。スキャンが実行され、新しい問題が検出された場合は失敗します。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/pr-torirsunogtingu/cli-for-pr-and-release-gating/github-action-setup-for-aikido-cli-release-gating.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
