Skip to content

Replace maintain-one-comment with find-comment and create-or-update-comment - #3267

Merged
nguyentvan7 merged 4 commits into
masterfrom
van/addPrComment
Jul 24, 2026
Merged

nguyentvan7 merged 4 commits into
masterfrom
van/addPrComment

Conversation

@nguyentvan7

@nguyentvan7 nguyentvan7 commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes

Add back comment maintenance in the action using a different set of actions

Issue or discord link

Testing/validation

Tested here nguyentvan7#60

Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)

  • I have commented my code in hard-to understand areas.
  • I have made corresponding changes to README or wiki.
  • For front-end changes, I have updated the corresponding English translations.
  • I have run yarn run mini-ci locally to validate format and lint.
  • If I have added a new library or app, I have updated the deployment scripts to ignore changes as needed

Summary by CodeRabbit

  • Bug Fixes
    • Deployment workflows now reliably locate the existing deployment status comment and create or update it, preventing duplicate or stale entries.
    • Updated comments reflect the current environment, deployed ref, and UTC timestamp.
    • Frontend deployments also include the published GitHub Pages URL.
  • Improvements
    • Deletion runs now update the same status comment with a “deleted deployment” notice and UTC timestamp.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c37226ea-9c6a-4802-8c23-a73e86c27111

📥 Commits

Reviewing files that changed from the base of the PR and between ea9e3b7 and 11afda4.

📒 Files selected for processing (1)
  • .github/workflows/deploy-somnia.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/deploy-somnia.yml

Walkthrough

Deployment and cleanup workflows now locate and update bot-authored deployment comments with timestamps, environments, frontend URLs, refs, or deletion status. Somnia’s workflow also removes an inline permission comment.

Changes

Deployment comment updates

Layer / File(s) Summary
Deployment comment upsert flow
.github/workflows/clean-pr.yml, .github/workflows/deploy-frontend.yml, .github/workflows/deploy-somnia.yml
Workflows find existing github-actions[bot] comments containing “Deployed” and create or update them with workflow-specific deployment or cleanup metadata. The Somnia workflow removes an inline comment from its id-token permission setting.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant FindComment
  participant CreateOrUpdateComment
  Workflow->>FindComment: Search issue or PR for bot comment containing “Deployed”
  FindComment-->>Workflow: Return matching comment ID
  Workflow->>CreateOrUpdateComment: Create or update deployment status
Loading

Possibly related PRs

Suggested labels: CI

Suggested reviewers: frzyc

Poem

Sleepless commits deploy at night,
Gacha sparks keep workflows bright.
Comments update, statuses stay,
Old deployment notes make way.
One more pull, then sleep—someday.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: swapping maintain-one-comment for find-comment and create-or-update-comment.
Description check ✅ Passed It includes the required summary and testing sections, and the checklist is present; only the issue/discord link is left blank.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch van/addPrComment

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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/clean-pr.yml:
- Around line 61-67: Update the cleanup comment step in
.github/workflows/clean-pr.yml to use a stable shared marker in both the
body-includes filter and the deleted-deployment body. Ensure the same marker is
used by the deployment workflows’ comment bodies and filters so subsequent
deploy and cleanup runs continue updating the existing comment instead of
creating duplicates.
- Around line 62-67: Update the “Create or update comment” steps in
.github/workflows/clean-pr.yml lines 62-67,
.github/workflows/deploy-frontend.yml lines 102-108, and
.github/workflows/deploy-somnia.yml lines 84-90 to pass the corresponding
find-comment step’s steps.fc.outputs.comment-id and set edit-mode to replace,
preserving one status comment per deployment.

In @.github/workflows/deploy-somnia.yml:
- Line 90: Update the deployment comment construction in the workflow step using
steps.output-date.outputs.date so the emitted comment contains only the intended
deployment text; remove the trailing quote and shell redirection syntax from the
comment body while preserving the actual GITHUB_OUTPUT write operation.
- Around line 76-86: Update the deploy job containing the “Find Comment” and
“Create or update comment” steps by adding job-level permissions for issues:
write and pull-requests: write, while preserving actions: read for the artifact
download steps. Ensure the peter-evans comment actions can write to both issue
and pull-request comments without removing required artifact permissions.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dac1e326-d263-4de0-bd74-a72c591a6315

📥 Commits

Reviewing files that changed from the base of the PR and between 7beb60c and 016874f.

📒 Files selected for processing (3)
  • .github/workflows/clean-pr.yml
  • .github/workflows/deploy-frontend.yml
  • .github/workflows/deploy-somnia.yml

Comment thread .github/workflows/clean-pr.yml
Comment thread .github/workflows/clean-pr.yml
Comment thread .github/workflows/deploy-somnia.yml
Comment thread .github/workflows/deploy-somnia.yml Outdated
@nguyentvan7
nguyentvan7 merged commit ad3507e into master Jul 24, 2026
10 checks passed
@nguyentvan7
nguyentvan7 deleted the van/addPrComment branch July 24, 2026 20:39
@github-actions

Copy link
Copy Markdown
Contributor

[Fri Jul 24 20:40:38 UTC 2026] - Deleted deployment

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