Skip to content

chore(ci): add weekly commit summary action with Claude#40213

Open
ggazzo wants to merge 8 commits into
developfrom
worktree-chore+weekly-summary-action
Open

chore(ci): add weekly commit summary action with Claude#40213
ggazzo wants to merge 8 commits into
developfrom
worktree-chore+weekly-summary-action

Conversation

@ggazzo
Copy link
Copy Markdown
Member

@ggazzo ggazzo commented Apr 18, 2026

Summary

  • Adds a new GitHub Action (.github/workflows/weekly-summary.yml) that runs every Friday at 09:00 UTC
  • Uses Claude (via claude-code-base-action) to analyze the week's commits and PR descriptions on develop
  • Generates a structured summary and posts it to a Rocket.Chat channel via incoming webhook

Report Sections

  1. Overview — high-level theme of the week
  2. User-Facing Changes — settings, permissions, UI, Omnichannel, LDAP, notifications
  3. Developer & API Changes — endpoints, schemas, Apps Engine, DDP, OpenAPI, breaking changes
  4. Needs Documentation / Action Required — flags items needing docs or admin action (reads PR bodies for migration steps, behavior changes, deprecations)
  5. Performance & Size Impact — Docker image, client bundle, load time changes with concrete numbers
  6. Internal / Infrastructure — brief summary of refactors, CI, deps, tests
  7. Stats — commit count, period, top contributors

Secrets Required

Secret Status
CLAUDE_CODE_OAUTH_TOKEN Already exists
WEEKLY_SUMMARY_WEBHOOK_URL New — Rocket.Chat incoming webhook URL

Test plan

  • Configure WEEKLY_SUMMARY_WEBHOOK_URL secret in repo settings
  • Trigger manually via workflow_dispatch and verify summary appears in Rocket.Chat channel
  • Verify the summary format and content quality
  • Test with a quiet week (few/no commits) to verify skip behavior

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added an automated weekly (plus manual trigger) workflow that gathers recent commits and PRs, generates an AI-written weekly Markdown summary, posts it to a configured Rocket.Chat webhook, and optionally applies a docs label to flagged PRs. The process safely skips when no commits are found and fails early if the webhook or generated summary is missing.

Adds a GitHub Action that runs every Friday at 09:00 UTC to generate
a weekly summary of merged commits on develop. Uses Claude to analyze
commit messages and PR descriptions, producing a structured report
covering user-facing changes, developer/API changes, documentation
needs, and performance impact. Posts the summary to Rocket.Chat via
incoming webhook.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ggazzo ggazzo requested a review from a team as a code owner April 18, 2026 03:46
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 18, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 18, 2026

⚠️ No Changeset found

Latest commit: 7e0146c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a new GitHub Actions workflow that weekly (and manually) collects non-merge commits from develop over the last 7 days, fetches PR metadata via gh, asks Anthropic Claude to produce a structured Markdown weekly summary, posts it to Rocket.Chat, and labels PRs needing docs.

Changes

Cohort / File(s) Summary
Weekly Summary Workflow
/.github/workflows/weekly-summary.yml
Adds a scheduled & manual workflow ("Weekly Commit Summary") that checks out develop (full history), collects up to 500 non-merge commits from the last 7 days, extracts PR numbers from commit subjects, fetches PR number, title, and body via gh, invokes anthropics/claude-code-base-action with a detailed prompt to generate a structured Markdown summary including a <!-- NEEDS_DOCS: ... --> marker, posts the summary to WEEKLY_SUMMARY_WEBHOOK_URL, applies the docs label to PRs referenced in the marker, and skips downstream steps when no commits are found.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as "GitHub Actions\n(weekly-summary.yml)"
    participant Git as "git / origin/develop"
    participant GH as "gh CLI"
    participant Claude as "Anthropic Claude\n(action)"
    participant Webhook as "Rocket.Chat\nWebhook"

    Workflow->>Git: checkout develop (full history)
    Workflow->>Git: list non-merge commits (last 7 days)
    alt commits found
        Workflow->>GH: extract PR numbers from commit subjects
        loop per PR
            GH->>GH: fetch PR number/title/body
            GH-->>Workflow: append PR details
        end
        Workflow->>Claude: send prompt + PR details
        Claude-->>Workflow: return structured Markdown (includes NEEDS_DOCS marker)
        Workflow->>Webhook: POST summary to WEEKLY_SUMMARY_WEBHOOK_URL
        Workflow->>GH: label referenced PRs with `docs`
    else no commits
        Workflow-->>Workflow: set has_commits=false and skip downstream steps
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 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 'chore(ci): add weekly commit summary action with Claude' clearly and concisely summarizes the primary change: introducing a new GitHub Actions workflow for weekly commit summaries powered by Claude.
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.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

ggazzo and others added 2 commits April 18, 2026 00:49
Claude now outputs a machine-readable NEEDS_DOCS comment at the end
of the summary. A new step parses those PR numbers and adds the
"docs" label to each one via gh pr edit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/weekly-summary.yml:
- Around line 31-40: COMMIT_COUNT is computed from the already-capped
COMMIT_LOG, underreporting when there are >500 commits; change the flow to first
capture an uncapped full commit list (e.g., FULL_COMMIT_LOG generated by git log
without piping to head), compute COMMIT_COUNT from that (use wc -l on
FULL_COMMIT_LOG), then create a capped version (pipe FULL_COMMIT_LOG through
head -500) and write that capped output to /tmp/weekly_commits.txt for Claude
input; apply the same change for the duplicate logic referenced around the
second occurrence (lines ~117-118) so stats use the uncapped count while only
the file fed to the model is limited.
- Around line 144-158: The jq extraction currently returns the Portuguese
fallback string "Erro ao extrair resumo." for unsupported .content shapes,
causing SUMMARY to be non-empty and the script to continue; update the jq
expression used to compute SUMMARY so the else branch yields an empty string (or
null) instead of the fallback text (i.e., change the else branch in the jq block
to "" or null) so that the subsequent check if [ -z "$SUMMARY" ] || [ "$SUMMARY"
= "null" ] will detect failure and the step will exit with an error.
- Around line 162-165: The curl webhook call lacks timeouts and doesn't handle
transport failures; update the curl invocation (the line that sets HTTP_CODE
using curl and variables WEBHOOK_URL and PAYLOAD) to include timeouts and
retries (e.g. --connect-timeout and --max-time, plus --retry/--retry-delay and
--silent --show-error), then capture curl's exit status and set a safe fallback
HTTP_CODE on transport failure (e.g. run HTTP_CODE=$(curl ... -w "%{http_code}"
...) ; CURL_EXIT=$? ; if [ "$CURL_EXIT" -ne 0 ]; then HTTP_CODE="000"; fi) so
stalled requests are bounded and network errors are detected instead of leaving
the job hanging.
- Around line 42-50: The workflow currently writes PR bodies to
/tmp/weekly_pr_details.txt and later grants the model broad Bash(cat:*) and View
access; to fix, stop giving the runtime Bash file-read capability and instead
inline the PR body content into the prompt or use a safe sandboxed storage
mechanism: modify the loop around PR_NUMBERS/ BODY to directly pass the captured
BODY string into the model prompt (avoid writing to /tmp) and remove any
allowed_tools entry that includes Bash(cat:*) or file read patterns;
alternatively replace Bash access with a restricted sandboxed tool that only
exposes the explicit BODY variable (or deny patterns) so the model cannot read
arbitrary workspace files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f9a3a8e0-34cd-401b-935a-c7d82e4d1f83

📥 Commits

Reviewing files that changed from the base of the PR and between 24b3671 and db54561.

📒 Files selected for processing (1)
  • .github/workflows/weekly-summary.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 📦 Meteor Build (coverage)
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Comment on lines +31 to +40
COMMIT_LOG=$(git log --since="${SINCE_DATE}" --oneline --no-merges --format="%h %s (%an)" origin/develop | head -500)

if [ -z "$COMMIT_LOG" ]; then
echo "has_commits=false" >> "$GITHUB_OUTPUT"
echo "No commits found in the last 7 days."
else
COMMIT_COUNT=$(echo "$COMMIT_LOG" | wc -l | tr -d ' ')
echo "has_commits=true" >> "$GITHUB_OUTPUT"
echo "commit_count=${COMMIT_COUNT}" >> "$GITHUB_OUTPUT"
echo "$COMMIT_LOG" > /tmp/weekly_commits.txt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid silently underreporting stats when the commit list is capped.

COMMIT_COUNT is computed after head -500, so a busy week with more than 500 non-merge commits will report 500 and skew the Stats section/top contributors. Keep an uncapped count for stats and only cap the file used as Claude input.

Proposed fix
-          COMMIT_LOG=$(git log --since="${SINCE_DATE}" --oneline --no-merges --format="%h %s (%an)" origin/develop | head -500)
+          COMMIT_LIMIT=500
+          TOTAL_COMMIT_COUNT=$(git rev-list --count --no-merges --since="${SINCE_DATE}" origin/develop)
+          COMMIT_LOG=$(git log --since="${SINCE_DATE}" --oneline --no-merges --format="%h %s (%an)" origin/develop | head -"${COMMIT_LIMIT}")

           if [ -z "$COMMIT_LOG" ]; then
             echo "has_commits=false" >> "$GITHUB_OUTPUT"
             echo "No commits found in the last 7 days."
           else
-            COMMIT_COUNT=$(echo "$COMMIT_LOG" | wc -l | tr -d ' ')
+            COMMIT_COUNT="${TOTAL_COMMIT_COUNT}"
             echo "has_commits=true" >> "$GITHUB_OUTPUT"
             echo "commit_count=${COMMIT_COUNT}" >> "$GITHUB_OUTPUT"
             echo "$COMMIT_LOG" > /tmp/weekly_commits.txt
+            if [ "$TOTAL_COMMIT_COUNT" -gt "$COMMIT_LIMIT" ]; then
+              {
+                echo ""
+                echo "_Note: commit list truncated to first ${COMMIT_LIMIT} of ${TOTAL_COMMIT_COUNT} commits._"
+              } >> /tmp/weekly_commits.txt
+            fi

Also applies to: 117-118

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/weekly-summary.yml around lines 31 - 40, COMMIT_COUNT is
computed from the already-capped COMMIT_LOG, underreporting when there are >500
commits; change the flow to first capture an uncapped full commit list (e.g.,
FULL_COMMIT_LOG generated by git log without piping to head), compute
COMMIT_COUNT from that (use wc -l on FULL_COMMIT_LOG), then create a capped
version (pipe FULL_COMMIT_LOG through head -500) and write that capped output to
/tmp/weekly_commits.txt for Claude input; apply the same change for the
duplicate logic referenced around the second occurrence (lines ~117-118) so
stats use the uncapped count while only the file fed to the model is limited.

Comment on lines +42 to +50
# Extract PR numbers and fetch their bodies for context on actions/behavior changes
PR_NUMBERS=$(echo "$COMMIT_LOG" | grep -oP '#\K[0-9]+' | sort -u)
echo "" > /tmp/weekly_pr_details.txt
for PR in $PR_NUMBERS; do
BODY=$(gh pr view "$PR" --json number,title,body --jq '"### PR #\(.number): \(.title)\n\(.body // "")\n---"' 2>/dev/null || true)
if [ -n "$BODY" ]; then
echo "$BODY" >> /tmp/weekly_pr_details.txt
fi
done
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

anthropics/claude-code-base-action allowed_tools syntax restrict Bash cat to specific file paths

💡 Result:

In Anthropic's Claude Code (repository anthropics/claude-code), there is no direct syntax in allowed_tools to restrict Bash's cat command to specific file paths. Permission rules like "Read(./allowed/)" in settings.json permissions.deny/allow only apply to built-in Read/Glob/Grep tools, not Bash subprocesses. Bash("cat ./allowed/file") bypasses these, as confirmed by open GitHub issues #39987, #45992 (as of 2026-04-10). allowed_tools syntax (comma-separated in SKILL.md frontmatter or settings.json permissions.allow) grants auto-approval for tools like "Bash(gh:*)", "Read", but does not parse/enforce file paths within Bash commands {#1,14,19}. To restrict Bash cat to paths: - Enable sandboxing (/sandbox or "sandbox":{"enabled":true}) for OS-level enforcement (bubblewrap/Seatbelt). Use "sandbox.filesystem.denyRead":["~/.ssh/","./secrets/"],"allowWrite":["./allowed/"] to block reads/writes outside paths at runtime for all Bash subprocesses {#12,19,59,61}. - deny Bash patterns: "permissions.deny":["Bash(cat ~)","Bash(grep .env)"] prevents specific commands but requires exhaustive patterns {#10,18}. - PreToolUse hooks or external wrappers (e.g., bubblewrap) for custom path scanning {#6}. Sandbox provides strongest restriction; permissions alone insufficient for Bash cat.

Citations:


🏁 Script executed:

cat -n .github/workflows/weekly-summary.yml | head -150

Repository: RocketChat/Rocket.Chat

Length of output: 9844


Restrict Claude's file-read access before processing untrusted PR bodies.

PR descriptions are contributor-controlled input, but line 132 grants broad Bash(cat:*) and View access. A malicious PR description could prompt the model to read unrelated runner or workspace files. The allowed_tools syntax in this action does not support file-path restrictions for Bash subprocesses—only sandboxing or pattern denials can enforce limits. Scope access via sandbox filesystem controls, deny Bash patterns entirely, or inline PR content directly in the prompt and remove Bash(cat:*).

Also applies to: 42–50, 63–69

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/weekly-summary.yml around lines 42 - 50, The workflow
currently writes PR bodies to /tmp/weekly_pr_details.txt and later grants the
model broad Bash(cat:*) and View access; to fix, stop giving the runtime Bash
file-read capability and instead inline the PR body content into the prompt or
use a safe sandboxed storage mechanism: modify the loop around PR_NUMBERS/ BODY
to directly pass the captured BODY string into the model prompt (avoid writing
to /tmp) and remove any allowed_tools entry that includes Bash(cat:*) or file
read patterns; alternatively replace Bash access with a restricted sandboxed
tool that only exposes the explicit BODY variable (or deny patterns) so the
model cannot read arbitrary workspace files.

Comment thread .github/workflows/weekly-summary.yml
Comment thread .github/workflows/weekly-summary.yml Outdated
Comment on lines +162 to +165
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "$WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Bound the webhook call and handle network failures explicitly.

Without curl timeouts, a stalled webhook can hold the job until the 15-minute workflow timeout. Also, curl transport failures can exit before the HTTP-code handler runs.

Proposed fix
-          HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
+          if ! HTTP_CODE=$(curl --silent --show-error \
+            --connect-timeout 10 \
+            --max-time 30 \
+            -o /tmp/weekly-summary-webhook-response.txt \
+            -w "%{http_code}" \
             -X POST "$WEBHOOK_URL" \
             -H "Content-Type: application/json" \
-            -d "$PAYLOAD")
+            -d "$PAYLOAD"); then
+            echo "::error::Failed to reach Rocket.Chat webhook"
+            exit 1
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "$WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
if ! HTTP_CODE=$(curl --silent --show-error \
--connect-timeout 10 \
--max-time 30 \
-o /tmp/weekly-summary-webhook-response.txt \
-w "%{http_code}" \
-X POST "$WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "$PAYLOAD"); then
echo "::error::Failed to reach Rocket.Chat webhook"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/weekly-summary.yml around lines 162 - 165, The curl
webhook call lacks timeouts and doesn't handle transport failures; update the
curl invocation (the line that sets HTTP_CODE using curl and variables
WEBHOOK_URL and PAYLOAD) to include timeouts and retries (e.g. --connect-timeout
and --max-time, plus --retry/--retry-delay and --silent --show-error), then
capture curl's exit status and set a safe fallback HTTP_CODE on transport
failure (e.g. run HTTP_CODE=$(curl ... -w "%{http_code}" ...) ; CURL_EXIT=$? ;
if [ "$CURL_EXIT" -ne 0 ]; then HTTP_CODE="000"; fi) so stalled requests are
bounded and network errors are detected instead of leaving the job hanging.

ggazzo and others added 2 commits April 18, 2026 00:51
Instructs Claude to place chores/refactors that affect APIs, OpenAPI
specs, or public interfaces in Developer & API Changes rather than
Internal, since their impact is developer-facing regardless of the
conventional commit type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@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.

♻️ Duplicate comments (4)
.github/workflows/weekly-summary.yml (4)

31-40: ⚠️ Potential issue | 🟡 Minor

Keep Stats uncapped when limiting Claude input.

COMMIT_COUNT is derived after head -500, so busy weeks report 500 even when more commits exist. Count the full range separately, and only cap /tmp/weekly_commits.txt.

Proposed fix
-          COMMIT_LOG=$(git log --since="${SINCE_DATE}" --oneline --no-merges --format="%h %s (%an)" origin/develop | head -500)
+          COMMIT_LIMIT=500
+          TOTAL_COMMIT_COUNT=$(git rev-list --count --no-merges --since="${SINCE_DATE}" origin/develop)
+          COMMIT_LOG=$(git log --since="${SINCE_DATE}" --oneline --no-merges --format="%h %s (%an)" origin/develop | head -"${COMMIT_LIMIT}")
 
           if [ -z "$COMMIT_LOG" ]; then
             echo "has_commits=false" >> "$GITHUB_OUTPUT"
             echo "No commits found in the last 7 days."
           else
-            COMMIT_COUNT=$(echo "$COMMIT_LOG" | wc -l | tr -d ' ')
+            COMMIT_COUNT="${TOTAL_COMMIT_COUNT}"
             echo "has_commits=true" >> "$GITHUB_OUTPUT"
             echo "commit_count=${COMMIT_COUNT}" >> "$GITHUB_OUTPUT"
             echo "$COMMIT_LOG" > /tmp/weekly_commits.txt
+            if [ "$TOTAL_COMMIT_COUNT" -gt "$COMMIT_LIMIT" ]; then
+              {
+                echo ""
+                echo "_Note: commit list truncated to first ${COMMIT_LIMIT} of ${TOTAL_COMMIT_COUNT} commits._"
+              } >> /tmp/weekly_commits.txt
+            fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/weekly-summary.yml around lines 31 - 40, COMMIT_COUNT is
being computed from the already-capped COMMIT_LOG (which uses head -500) so busy
weeks incorrectly show 500; run git log --since="${SINCE_DATE}" --oneline
--no-merges --format="%h %s (%an)" origin/develop once into a full variable
(e.g., FULL_COMMIT_LOG) to derive COMMIT_COUNT from the full results, then
create a capped version (pipe FULL_COMMIT_LOG | head -500) and write that capped
output to /tmp/weekly_commits.txt while still exporting the true commit_count
derived from FULL_COMMIT_LOG; keep the existing output variables has_commits and
commit_count logic but switch their inputs to FULL_COMMIT_LOG and the capped
file respectively.

167-170: ⚠️ Potential issue | 🟡 Minor

Bound the webhook request and handle transport failures.

Without curl timeouts, a stalled webhook can hold the job until the workflow timeout; transport failures can also bypass clean HTTP-code handling.

Proposed fix
-          HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
+          if ! HTTP_CODE=$(curl --silent --show-error \
+            --connect-timeout 10 \
+            --max-time 30 \
+            --retry 2 \
+            --retry-delay 5 \
+            -o /tmp/weekly-summary-webhook-response.txt \
+            -w "%{http_code}" \
             -X POST "$WEBHOOK_URL" \
             -H "Content-Type: application/json" \
-            -d "$PAYLOAD")
+            -d "$PAYLOAD"); then
+            echo "::error::Failed to reach Rocket.Chat webhook"
+            exit 1
+          fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/weekly-summary.yml around lines 167 - 170, Add network
timeouts and explicit transport-failure handling to the curl call that sets
HTTP_CODE: include options like --connect-timeout and --max-time (and
--fail/--show-error if desired) when invoking curl with WEBHOOK_URL and PAYLOAD,
then capture curl's exit status ($?) after the request and translate non-zero
exits into a sentinel HTTP_CODE (e.g., "000" or log-and-fail) so that transport
failures don't slip past HTTP-code handling; update references around the
HTTP_CODE assignment and any downstream checks so they treat non-2xx/000 as
failures.

149-158: ⚠️ Potential issue | 🟠 Major

Fail extraction instead of posting fallback error text.

The else branch returns non-empty "Erro ao extrair resumo.", so the next check treats extraction failure as a valid Rocket.Chat message.

Proposed fix
-          SUMMARY=$(jq -r '
-            [.[] | select(.role == "assistant")] | last |
-            if .content | type == "array" then
-              [.content[] | select(.type == "text") | .text] | join("\n")
-            elif .content | type == "string" then
-              .content
-            else
-              "Erro ao extrair resumo."
-            end
-          ' "$EXECUTION_FILE")
+          if ! SUMMARY=$(jq -r '
+            ([.[] | select(.role == "assistant")] | last) as $message |
+            if $message == null then
+              ""
+            elif ($message.content | type) == "array" then
+              [$message.content[] | select(.type == "text") | .text] | join("\n")
+            elif ($message.content | type) == "string" then
+              $message.content
+            else
+              ""
+            end
+          ' "$EXECUTION_FILE"); then
+            echo "::error::Failed to parse Claude execution log"
+            exit 1
+          fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/weekly-summary.yml around lines 149 - 158, The jq
extraction currently returns the literal "Erro ao extrair resumo." on the else
branch which makes SUMMARY non-empty and treated as a valid message; update the
else branch in the jq block that builds SUMMARY so it emits an empty string
(e.g., replace "Erro ao extrair resumo." with "") or jq empty output, ensuring
SUMMARY is empty on failure and the downstream check will treat extraction as
failed; look for the SUMMARY assignment and the conditional branches inspecting
.content | type inside that jq script to apply this change.

42-50: ⚠️ Potential issue | 🟠 Major

Do not grant broad file-read tools while processing PR bodies.

PR bodies are contributor-controlled prompt input, but Claude gets Bash(cat:*) and View, so prompt injection can steer it toward reading unrelated runner/workspace files. Inline the prepared commit/PR text into the prompt, or run the model in a sandbox that exposes only those files.

For anthropics/claude-code-base-action / Claude Code, does allowed_tools support path-restricting Bash(cat:*), and what sandbox or permission configuration prevents Bash subprocesses from reading arbitrary workspace files?

Also applies to: 60-133

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/weekly-summary.yml:
- Around line 31-40: COMMIT_COUNT is being computed from the already-capped
COMMIT_LOG (which uses head -500) so busy weeks incorrectly show 500; run git
log --since="${SINCE_DATE}" --oneline --no-merges --format="%h %s (%an)"
origin/develop once into a full variable (e.g., FULL_COMMIT_LOG) to derive
COMMIT_COUNT from the full results, then create a capped version (pipe
FULL_COMMIT_LOG | head -500) and write that capped output to
/tmp/weekly_commits.txt while still exporting the true commit_count derived from
FULL_COMMIT_LOG; keep the existing output variables has_commits and commit_count
logic but switch their inputs to FULL_COMMIT_LOG and the capped file
respectively.
- Around line 167-170: Add network timeouts and explicit transport-failure
handling to the curl call that sets HTTP_CODE: include options like
--connect-timeout and --max-time (and --fail/--show-error if desired) when
invoking curl with WEBHOOK_URL and PAYLOAD, then capture curl's exit status ($?)
after the request and translate non-zero exits into a sentinel HTTP_CODE (e.g.,
"000" or log-and-fail) so that transport failures don't slip past HTTP-code
handling; update references around the HTTP_CODE assignment and any downstream
checks so they treat non-2xx/000 as failures.
- Around line 149-158: The jq extraction currently returns the literal "Erro ao
extrair resumo." on the else branch which makes SUMMARY non-empty and treated as
a valid message; update the else branch in the jq block that builds SUMMARY so
it emits an empty string (e.g., replace "Erro ao extrair resumo." with "") or jq
empty output, ensuring SUMMARY is empty on failure and the downstream check will
treat extraction as failed; look for the SUMMARY assignment and the conditional
branches inspecting .content | type inside that jq script to apply this change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc1f3f26-53ac-4798-ae6e-88415a640d98

📥 Commits

Reviewing files that changed from the base of the PR and between db54561 and deb9cef.

📒 Files selected for processing (1)
  • .github/workflows/weekly-summary.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 📦 Meteor Build (coverage)
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-04-14T23:26:19.461Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 40159
File: .github/actions/setup-node/action.yml:44-59
Timestamp: 2026-04-14T23:26:19.461Z
Learning: In RocketChat/Rocket.Chat's CI composite actions (e.g. `.github/actions/setup-node/action.yml`), writing resolved tool versions directly to `$GITHUB_ENV` via `echo "VAR=value" >> $GITHUB_ENV` (without multiline heredoc form or explicit empty-value guards) is an accepted, intentional pattern. The source files (`package.json` engines field and `.tool-versions`) are considered stable and trusted, so flagging the absence of newline/empty validation or the use of the heredoc form is not warranted.

Applied to files:

  • .github/workflows/weekly-summary.yml
🔇 Additional comments (1)
.github/workflows/weekly-summary.yml (1)

196-207: Remove or defer this change—the bash -e concern does not apply to this workflow.

The workflow uses run: | (standard bash without -e flag), so the grep no-match scenario does not cause an early exit. When grep finds no matches without -e, the pipeline simply returns an empty result, and the subsequent if [ -z "$DOCS_PRS" ] check correctly handles it. The proposed bash -e test case does not reflect the actual execution environment.

Regarding allowlisting: While extracting PRs only from the actual commit log adds defensive filtering, it assumes PR numbers are consistently present and extractable from commit messages (e.g., "Merge pull request #123"), which is not guaranteed. This adds complexity without clear verification that the pattern will reliably match your commits. If you want to add this validation, first confirm your commit message format consistently includes extractable PR numbers.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.85%. Comparing base (2b4bd13) to head (7e0146c).
⚠️ Report is 24 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40213      +/-   ##
===========================================
+ Coverage    69.81%   69.85%   +0.03%     
===========================================
  Files         3291     3295       +4     
  Lines       119089   119166      +77     
  Branches     21484    21464      -20     
===========================================
+ Hits         83138    83238     +100     
+ Misses       32657    32634      -23     
  Partials      3294     3294              
Flag Coverage Δ
unit 70.56% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ggazzo and others added 3 commits April 18, 2026 01:04
Rocket.Chat does not render markdown tables. Instructs Claude to use
bullet lists or code blocks instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instructs Claude to use [#40123](url) format so PR references are
clickable in Rocket.Chat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rocket.Chat incoming webhooks have a per-message size limit (default
~5000 chars). Large summaries (e.g., release summaries covering many
commits) failed with error-message-size-exceeded. Uses Python to split
the summary at "### " section boundaries, producing chunks under the
limit, and posts each chunk sequentially.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant