From c587d89be247006e3a767d1bf1fa2d48d9c11107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=84=B1=EC=A7=84?= Date: Fri, 29 May 2026 01:35:50 +0900 Subject: [PATCH] =?UTF-8?q?[claude-github-mcp]=20chore=20:=20ci(github-act?= =?UTF-8?q?ions):=20@claude=20Notion=20MCP=20=EB=93=B1=EB=A1=9D=20+=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=EB=A6=AC=EB=B7=B0=20--comment=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=20=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - claude.yml: 런타임 .mcp.json 생성 step + NOTION_TOKEN/OPENAPI_MCP_HEADERS env + allowedTools에 mcp__notion__* 추가 (backend 검증 설정 미러링, 프론트 패키지매니저 권한 보존) - claude-code-review.yml: /code-review prompt에 --comment 추가 (automation 모드에서 결과가 PR에 안 올라오던 문제 수정) Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/claude-code-review.yml | 3 ++- .github/workflows/claude.yml | 27 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 075fc66b8..ebd15cfd3 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -39,7 +39,8 @@ jobs: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' - prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' + # --comment: 리뷰 findings를 PR 인라인 코멘트로 게시. 미지정 시 automation 모드에서 결과가 모델 출력에만 남아 PR엔 안 보임(= success인데 리뷰 없음). + prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }} --comment' # 자동 리뷰 완료 시 프론트엔드 Slack 채널에 알림. 기존 PR open 알림과는 별도 메시지로 구분. - name: Notify Slack on review complete diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 377ea99c4..498f43963 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -30,9 +30,32 @@ jobs: with: fetch-depth: 1 + # claude-code-action은 working dir의 .mcp.json을 enableAllProjectMcpServers로 자동 로드한다. + # repo에 .mcp.json을 두지 않고(로컬 환경 침범 방지) 워크플로우 실행 중에만 생성하여 Notion MCP를 등록. + # claude_args의 --mcp-config는 v1에서 무시되는 정황이 확인되어 자동 로드 경로를 사용. + - name: Generate .mcp.json for Notion MCP + run: | + cat > .mcp.json <<'JSON' + { + "mcpServers": { + "notion": { + "command": "npx", + "args": ["-y", "@notionhq/notion-mcp-server"] + } + } + } + JSON + - name: Run Claude Code id: claude uses: anthropics/claude-code-action@v1 + env: + # Notion MCP 서버(@notionhq/notion-mcp-server)가 OpenAPI 호출 시 사용할 인증 헤더. + # npx 자식 프로세스가 step env를 자동 상속하므로 MCP config 파일에는 별도로 명시하지 않음. + # 토큰은 "스터디 플랫폼 : 코드 제로투원" 페이지에 connection된 integration의 권한 범위 내에서만 동작. + OPENAPI_MCP_HEADERS: '{"Authorization":"Bearer ${{ secrets.NOTION_TOKEN }}","Notion-Version":"2022-06-28"}' + # @notionhq/notion-mcp-server가 NOTION_TOKEN을 직접 읽는 케이스 fallback. + NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} @@ -40,8 +63,8 @@ jobs: additional_permissions: | actions: read - # 프론트엔드 작업에 필요한 패키지 매니저 명령어 허용 - claude_args: '--allowed-tools "Bash(npm *),Bash(yarn *),Bash(pnpm *),Bash(npx *)"' + # 자동 로드된 mcp__notion__*가 LLM에 노출되도록 + 프론트엔드 패키지 매니저 명령어 허용 + claude_args: '--allowedTools "mcp__notion__*,Bash(npm *),Bash(yarn *),Bash(pnpm *),Bash(npx *),Edit,Write,Read,Glob,Grep,LS"' # Claude 응답 완료 시 프론트엔드 Slack 채널에 알림. 성공/실패 모두 통지하여 쿼터 소진 등 에러 상황도 추적 가능하게 함. - name: Notify Slack on Claude response