はじめに サーバーレス開発部@大阪の岩田です。 前編に引き続き、SonarQubeを用いたソースコードの静的解析について見ていきます。 今回は前回の設定を発展させて、GitHubのプルリクを検知して、ソースコードの解析とレビューコメントの投稿までを自動化してみます。 こんな感じのコメントを自動で投稿するのが目標です↓ 大まかな流れは下記の通りです。 GitHubがプルリクエストを検知し、プルリクエストの情報をSNSに通知 SNSをトリガーにLambdaが起動、LambdaがCodeBuildのジョブを実行 CodeBuildのジョブがSonarScannerで変更箇所をスキャン スキャン結果をプルリクエストのレビューコメントとして登録 環境構築 前回構築したSonarQubeの環境をベースに早速環境を構築していきます!! SonarQubeにGitHubプラグインを導入 SonarQube