> 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-torirsugtingu/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 Release Gated Scan
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 Client をインストール
        run: npm install --global @aikidosec/ci-api-client

      # ステップ 3: Aikido Scan Release を実行
      - name: Aikido Scan を実行
        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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
