Skip to content

Conversation

@oikon48
Copy link
Owner

@oikon48 oikon48 commented Jan 27, 2026

Summary

Claude Code Actionによる要約生成の信頼性を向上させるための修正です。

問題点

  • max-turns: 1 が厳しすぎて20%の失敗率
  • 要約が常に空になる(jq抽出の問題)
  • セキュリティ検証でActionのSHAピンニング推奨

変更内容

修正 内容
permissions id-token: write 追加(OIDC認証用)
checkout v4 → v6
claude-code-action タグ → SHAピンニング
diff_content 200行 → 50行(メモリ制限回避)
model opus → sonnet-4-5(コスト削減)
max-turns 1 → 3(信頼性向上)
max-tokens 1024追加
抽出 structured_output 優先、env:ブロック使用
エラー処理 continue-on-error: true 追加

Test plan

  • ワークフローがエラーなく完了
  • Discord通知にAI要約が含まれる
  • Claude失敗時もデフォルトメッセージで継続

Summary by CodeRabbit

  • Chores
    • Upgraded GitHub Actions workflow configuration with improved authentication and dependency updates
    • Enhanced change notification system with better summary extraction logic and fallback handling
    • Updated Discord notification formatting with cleaner labels and improved readability
    • Optimized workflow performance by reducing diff content limits to prevent memory issues

✏️ Tip: You can customize this high-level summary in your review settings.

Changes:
- Add permissions block with id-token: write for OIDC auth
- Update actions/checkout to v6
- Pin claude-code-action to SHA for security
- Reduce diff_content limit from 200 to 50 lines (avoid memory limit)
- Use structured_output with JSON schema for reliable extraction
- Change model from opus to sonnet-4-5 (cost/performance)
- Increase max-turns from 1 to 3 for reliability
- Add continue-on-error for graceful degradation
- Use env block for safe JSON handling
@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

A GitHub Actions workflow configuration update that upgrades checkout and Claude Code Action versions, adjusts AI model parameters from opus to sonnet with increased token/turn limits, refines summary extraction logic to prioritize structured output with character truncation, and reformats Discord notification fields by removing emoji prefixes from labels.

Changes

Cohort / File(s) Summary
Workflow Dependencies & Permissions
.github/workflows/notify-changes.yml
Bumped checkout action from v4 to v6; added explicit permissions (contents: read, id-token: write) for OIDC authentication with Claude Code Action.
Claude Code Action Configuration
.github/workflows/notify-changes.yml
Upgraded Claude Code Action from v1 to newer beta version with continue-on-error enabled; switched model from claude-opus-4-5 to claude-sonnet-4-5; increased max-turns from 1 to 3; adjusted prompt to request 3-sentence Japanese summary; enabled JSON schema for structured output.
Diff Collection & Summary Extraction
.github/workflows/notify-changes.yml
Reduced diff brief content limit from 200 to 50 lines; revised extraction logic to prioritize structured_output environment variable before falling back to execution file parsing; added markdown removal and 1000-character truncation to summary value.
Discord Notification Formatting
.github/workflows/notify-changes.yml
Removed emoji prefixes from field labels and titles in Discord payload; updated field naming conventions and ensured summary string is included in embed; adjusted success/failure feedback messaging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A workflow refreshed with newer grace,
Sonnet swaps opus in this place,
Permissions guarded, output bright,
Discord fields stripped clean of light,
The automation hops with might!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: improving Claude Code summary extraction through the use of structured_output, which is a core improvement across the workflow modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@oikon48 oikon48 merged commit 1d54893 into main Jan 27, 2026
1 check was pending
@oikon48 oikon48 deleted the fix/workflow-notify-changes branch January 27, 2026 15:43
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/notify-changes.yml:
- Around line 143-145: The current sed substitution on SUMMARY (the line using
sed 's/```[^`]*```//g') won't match multiline code fences; change the
transformation so SUMMARY has multiline code blocks removed reliably—either run
SUMMARY through a single-command Perl regex that enables dot-all matching to
strip ```...``` spans or first collapse newlines to a single byte stream before
applying the existing sed, then restore/truncate; update the operation that
assigns SUMMARY to use one of these approaches and keep the subsequent tr and
head truncation intact.

Comment on lines +143 to +145
# Clean up the summary
SUMMARY=$(echo "$SUMMARY" | sed 's/```[^`]*```//g' | tr '\n' ' ' | head -c 1000)
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Sed pattern may not remove multiline code blocks.

The regex s/```[^]*```//gdoesn't match across newlines in basic sed, so multiline code blocks may not be fully stripped. Consider usingawk` or piping through `tr '\n' '\x00'` first if this becomes an issue.

For now, this is acceptable since the truncation and Discord's field limit provide a safety net.

🤖 Prompt for AI Agents
In @.github/workflows/notify-changes.yml around lines 143 - 145, The current sed
substitution on SUMMARY (the line using sed 's/```[^`]*```//g') won't match
multiline code fences; change the transformation so SUMMARY has multiline code
blocks removed reliably—either run SUMMARY through a single-command Perl regex
that enables dot-all matching to strip ```...``` spans or first collapse
newlines to a single byte stream before applying the existing sed, then
restore/truncate; update the operation that assigns SUMMARY to use one of these
approaches and keep the subsequent tr and head truncation intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants