diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index 066e04c0..4e44036d 100644 --- a/.github/workflows/plugin-artifact-for-pr.yml +++ b/.github/workflows/plugin-artifact-for-pr.yml @@ -39,10 +39,35 @@ jobs: const runId = context.runId; const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}`; const slug = process.env.PLUGIN_SLUG; - const body = `ℹ️ [Download the ${slug} plugin artifact from this workflow run](${artifactUrl}) (see the 'Artifacts' section at the bottom).`; - await github.rest.issues.createComment({ + const body = `ℹ️ [Download the latest ${slug} plugin artifact from this workflow run](${artifactUrl})\n\n(See the 'Artifacts' section at the bottom).`; + + // Find existing comment from this bot + const comments = await github.rest.issues.listComments({ issue_number: pr.number, owner: context.repo.owner, - repo: context.repo.repo, - body + repo: context.repo.repo }); + + const botComment = comments.data.find(comment => + comment.user.type === 'Bot' && + comment.user.login === 'github-actions[bot]' && + comment.body.includes(`Download the latest ${slug} plugin artifact`) + ); + + if (botComment) { + // Update existing comment + await github.rest.issues.updateComment({ + comment_id: botComment.id, + owner: context.repo.owner, + repo: context.repo.repo, + body + }); + } else { + // Create new comment + await github.rest.issues.createComment({ + issue_number: pr.number, + owner: context.repo.owner, + repo: context.repo.repo, + body + }); + } diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index a3b09a08..0b494b4c 100644 --- a/plugins/wp-graphql-headless-webhooks/README.md +++ b/plugins/wp-graphql-headless-webhooks/README.md @@ -1,5 +1,5 @@ # WPGraphQL Headless Webhooks - + ## Overview A WordPress plugin that extends [WPGraphQL](https://www.wpgraphql.com/) to support webhook subscriptions and dispatching for headless WordPress environments. This allows external applications to listen and respond to WordPress content changes through GraphQL-driven webhook events.