Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

ci: update comment (#35968)

Asuka Minato65c36a51eff1
diff --git a/.github/workflows/pyrefly-diff-comment.yml b/.github/workflows/pyrefly-diff-comment.yml
index 7f82942e7e1..8e16baf9337 100644
--- a/.github/workflows/pyrefly-diff-comment.yml
+++ b/.github/workflows/pyrefly-diff-comment.yml
@@ -77,10 +77,28 @@ jobs:
}
if (diff.trim()) {
- await github.rest.issues.createComment({
+ const body = '### Pyrefly Diff\n<details>\n<summary>base → PR</summary>\n\n```diff\n' + diff + '\n```\n</details>';
+ const marker = '### Pyrefly Diff';
+ const { data: comments } = await github.rest.issues.listComments({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
- body: '### Pyrefly Diff\n<details>\n<summary>base → PR</summary>\n\n```diff\n' + diff + '\n```\n</details>',
});
+ const existing = comments.find((comment) => comment.body.startsWith(marker));
+
+ if (existing) {
+ await github.rest.issues.updateComment({
+ comment_id: existing.id,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body,
+ });
+ } else {
+ await github.rest.issues.createComment({
+ issue_number: prNumber,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body,
+ });
+ }
}
diff --git a/.github/workflows/pyrefly-diff.yml b/.github/workflows/pyrefly-diff.yml
index 0cf54e3585a..386bd257514 100644
--- a/.github/workflows/pyrefly-diff.yml
+++ b/.github/workflows/pyrefly-diff.yml
@@ -103,9 +103,26 @@ jobs:
].join('\n')
: '### Pyrefly Diff\nNo changes detected.';
- await github.rest.issues.createComment({
+ const marker = '### Pyrefly Diff';
+ const { data: comments } = await github.rest.issues.listComments({
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.repo,
- body,
});
+ const existing = comments.find((comment) => comment.body.startsWith(marker));
+
+ if (existing) {
+ await github.rest.issues.updateComment({
+ comment_id: existing.id,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body,
+ });
+ } else {
+ await github.rest.issues.createComment({
+ issue_number: prNumber,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body,
+ });
+ }