diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index c72cfcfc025..c7c97b2fae9 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -258,3 +258,4 @@ jobs: repo: ${{ github.repository }} pr-number: ${{ github.event.pull_request.number || github.event.issue.number }} github-token: ${{ secrets.GITHUB_TOKEN }} + review-result: ${{ needs.review.result }} diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 4db669b981f..f17633b7933 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -98,6 +98,7 @@ jobs: with: repository: shellhub-io/claude token: ${{ steps.app-token.outputs.token }} + persist-credentials: false fetch-depth: 1 path: claude @@ -105,10 +106,28 @@ jobs: run: | "$GITHUB_WORKSPACE/claude/workspace.sh" sync -w "$GITHUB_WORKSPACE" --project shellhub + - name: Verify the workspace config is readable + run: | + for file in \ + "$GITHUB_WORKSPACE/claude/CLAUDE.md" \ + "$GITHUB_WORKSPACE/claude/shellhub/CLAUDE.md" \ + "$GITHUB_WORKSPACE/claude/.claude/rules/code-style.md" \ + "$GITHUB_WORKSPACE/claude/.claude/skills/code-review/SKILL.md"; do + if [[ ! -f "$file" ]]; then + echo "::error::Workspace config not found at $file" + exit 1 + fi + done + - name: Run Claude timeout-minutes: 60 uses: anthropics/claude-code-action@8251c103ac8c1d761882c86aba1412c7f583c844 # v1 + env: + CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: "1" with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }} trigger_phrase: "@claude" + claude_args: | + --add-dir ${{ github.workspace }}/claude + --add-dir ${{ github.workspace }}/claude/shellhub