From 526da79364f0363092d7c9ae3d94f8eeaab8eeaa Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:32:53 -0400 Subject: [PATCH 01/13] Update plugin-artifact-for-pr.yml --- .github/workflows/plugin-artifact-for-pr.yml | 33 +++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index 066e04c0..42a7e1ae 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 ${slug} plugin artifact from this workflow run](${artifactUrl}) (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 ${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 + }); + } From 57636b5ce0e0d0c03e3d2152bdeb42eb8c100a8f Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:40:52 -0400 Subject: [PATCH 02/13] Update README.md --- plugins/wp-graphql-headless-webhooks/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index a3b09a08..27b91be6 100644 --- a/plugins/wp-graphql-headless-webhooks/README.md +++ b/plugins/wp-graphql-headless-webhooks/README.md @@ -25,3 +25,5 @@ Clone the repository or download the latest release and place it in your WordPre ## License WP GPL 2 + + From cf8f4926e03cd880fff623b374dbaead520ea02a Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:42:05 -0400 Subject: [PATCH 03/13] Update README.md --- plugins/wp-graphql-headless-webhooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index 27b91be6..02d09f15 100644 --- a/plugins/wp-graphql-headless-webhooks/README.md +++ b/plugins/wp-graphql-headless-webhooks/README.md @@ -26,4 +26,4 @@ Clone the repository or download the latest release and place it in your WordPre ## License WP GPL 2 - + From eb7300ea9f7d13b60187d5353dbe95c376729a1c Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:44:44 -0400 Subject: [PATCH 04/13] Update plugin-artifact-for-pr.yml --- .github/workflows/plugin-artifact-for-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index 42a7e1ae..c86ea552 100644 --- a/.github/workflows/plugin-artifact-for-pr.yml +++ b/.github/workflows/plugin-artifact-for-pr.yml @@ -39,7 +39,7 @@ 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).`; + 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({ From 619dfbca8eb99b5e90622c20ee03bc483714fb94 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:50:00 -0400 Subject: [PATCH 05/13] Experiment with improved layout --- .github/workflows/plugin-artifact-for-pr.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index c86ea552..40382e15 100644 --- a/.github/workflows/plugin-artifact-for-pr.yml +++ b/.github/workflows/plugin-artifact-for-pr.yml @@ -39,7 +39,16 @@ 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 latest ${slug} plugin artifact from this workflow run](${artifactUrl})\n\n(See the 'Artifacts' section at the bottom).`; + const body = `
+HWP Toolkit + + +**Download the latest ${slug} plugin artifact** + +🔗 [View workflow run with artifacts](${artifactUrl}) + +See the 'Artifacts' section at the bottom of the workflow run page. +
`; // Find existing comment from this bot const comments = await github.rest.issues.listComments({ From bf2e2d7cdd22a1e757cd0a78ef891c585abae445 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:50:46 -0400 Subject: [PATCH 06/13] Update README.md --- plugins/wp-graphql-headless-webhooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index 02d09f15..db03f1e4 100644 --- a/plugins/wp-graphql-headless-webhooks/README.md +++ b/plugins/wp-graphql-headless-webhooks/README.md @@ -26,4 +26,4 @@ Clone the repository or download the latest release and place it in your WordPre ## License WP GPL 2 - + From 56cd033d98d0e5f5adc18b8d512d645f63e306a3 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:52:00 -0400 Subject: [PATCH 07/13] Update README.md --- plugins/wp-graphql-headless-webhooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index db03f1e4..27b91be6 100644 --- a/plugins/wp-graphql-headless-webhooks/README.md +++ b/plugins/wp-graphql-headless-webhooks/README.md @@ -26,4 +26,4 @@ Clone the repository or download the latest release and place it in your WordPre ## License WP GPL 2 - + From 4cbab1e6ae85d63f5fa7931f1bdadc6c2a613381 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:53:03 -0400 Subject: [PATCH 08/13] Update README.md --- plugins/wp-graphql-headless-webhooks/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index 27b91be6..a3b09a08 100644 --- a/plugins/wp-graphql-headless-webhooks/README.md +++ b/plugins/wp-graphql-headless-webhooks/README.md @@ -25,5 +25,3 @@ Clone the repository or download the latest release and place it in your WordPre ## License WP GPL 2 - - From 7afa8677f02692dc62fd8f347fb4a2ec59fe21c8 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:54:27 -0400 Subject: [PATCH 09/13] Update layout --- .github/workflows/plugin-artifact-for-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index 40382e15..8a1023c9 100644 --- a/.github/workflows/plugin-artifact-for-pr.yml +++ b/.github/workflows/plugin-artifact-for-pr.yml @@ -40,7 +40,7 @@ jobs: const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}`; const slug = process.env.PLUGIN_SLUG; const body = `
-HWP Toolkit +HWP Toolkit **Download the latest ${slug} plugin artifact** From 59aab21b4fceb87cea308e18119c5307a071a2c3 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:55:42 -0400 Subject: [PATCH 10/13] Update README.md --- plugins/wp-graphql-headless-webhooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index a3b09a08..81a0c0d3 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. From 6fb6805ab58826fc9c6d286f811de9d9cd814744 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 12:58:11 -0400 Subject: [PATCH 11/13] Update plugin-artifact-for-pr.yml --- .github/workflows/plugin-artifact-for-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index 8a1023c9..42c34b15 100644 --- a/.github/workflows/plugin-artifact-for-pr.yml +++ b/.github/workflows/plugin-artifact-for-pr.yml @@ -60,7 +60,7 @@ jobs: const botComment = comments.data.find(comment => comment.user.type === 'Bot' && comment.user.login === 'github-actions[bot]' && - comment.body.includes(`Download the ${slug} plugin artifact`) + comment.body.includes(`Download the latest ${slug} plugin artifact`) ); if (botComment) { From cd240e5a9cf89b4aa9fc4f0112faf0d777492954 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 13:00:06 -0400 Subject: [PATCH 12/13] test: Trigger workflow with plugin file change --- plugins/wp-graphql-headless-webhooks/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wp-graphql-headless-webhooks/README.md b/plugins/wp-graphql-headless-webhooks/README.md index 81a0c0d3..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. From 2c6154a6e0030cbaa9ff98f8c43fcbaeb0664ae3 Mon Sep 17 00:00:00 2001 From: Joe Fusco Date: Thu, 12 Jun 2025 13:08:00 -0400 Subject: [PATCH 13/13] Update plugin-artifact-for-pr.yml --- .github/workflows/plugin-artifact-for-pr.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/plugin-artifact-for-pr.yml b/.github/workflows/plugin-artifact-for-pr.yml index 42c34b15..4e44036d 100644 --- a/.github/workflows/plugin-artifact-for-pr.yml +++ b/.github/workflows/plugin-artifact-for-pr.yml @@ -39,16 +39,7 @@ 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 = `
-HWP Toolkit - - -**Download the latest ${slug} plugin artifact** - -🔗 [View workflow run with artifacts](${artifactUrl}) - -See the 'Artifacts' section at the bottom of the workflow run page. -
`; + 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({