From 6c2929c78a060a8a5dbf1d49e1787b1bc866246a Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 08:56:40 +0200 Subject: [PATCH 1/8] Update the Annoucement generator file --- .github/scripts/generate-announcement.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/scripts/generate-announcement.js b/.github/scripts/generate-announcement.js index 3b28f6373..761d7bb40 100644 --- a/.github/scripts/generate-announcement.js +++ b/.github/scripts/generate-announcement.js @@ -120,12 +120,5 @@ async function githubGet(url) { console.log(""); - console.log( - JSON.stringify( - announcementPRs, - null, - 2 - ) - ); - -})(); + console.log(markdown); +})(); \ No newline at end of file From 5540d6bcc07ea26cbd628a2915d4c666d749c799 Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 09:20:00 +0200 Subject: [PATCH 2/8] update printscript --- .github/scripts/generate-announcement.js | 30 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/scripts/generate-announcement.js b/.github/scripts/generate-announcement.js index 761d7bb40..fdf936cc3 100644 --- a/.github/scripts/generate-announcement.js +++ b/.github/scripts/generate-announcement.js @@ -115,10 +115,32 @@ async function githubGet(url) { } //-------------------------------------------------- - // Print collected data - //-------------------------------------------------- +// Build Weekly Announcement +//-------------------------------------------------- + +function summarizePR(pr) { + return pr.body && pr.body.trim() !== "" + ? pr.body + : pr.title; +} + +let markdown = "# Weekly Developer Announcement\n\n"; + +for (const pr of announcementPRs) { + + markdown += `## ${pr.title}\n\n`; + + markdown += `${summarizePR(pr)}\n\n`; + + markdown += "---\n\n"; + +} + +//-------------------------------------------------- +// Print announcement +//-------------------------------------------------- - console.log(""); +console.log(""); +console.log(markdown); - console.log(markdown); })(); \ No newline at end of file From db65a8c3a4ba244891639e1218999a1c62981286 Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 09:48:13 +0200 Subject: [PATCH 3/8] remove unwanted description --- .github/scripts/generate-announcement.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/scripts/generate-announcement.js b/.github/scripts/generate-announcement.js index fdf936cc3..846b593c6 100644 --- a/.github/scripts/generate-announcement.js +++ b/.github/scripts/generate-announcement.js @@ -119,9 +119,20 @@ async function githubGet(url) { //-------------------------------------------------- function summarizePR(pr) { - return pr.body && pr.body.trim() !== "" - ? pr.body - : pr.title; + + if (!pr.body || pr.body.trim() === "") { + return pr.title; + } + + const summaryMatch = pr.body.match( + /## Summary\s*([\s\S]*?)(?=\n## |\n---|$)/i + ); + + if (summaryMatch) { + return summaryMatch[1].trim(); + } + + return pr.body.split("\n")[0].trim(); } let markdown = "# Weekly Developer Announcement\n\n"; From f6707411ec872bbe44dd4e42b5071d68a44e61c6 Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 11:42:27 +0200 Subject: [PATCH 4/8] copilot --- .../workflows/weekly-developer-announcement.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/weekly-developer-announcement.yml b/.github/workflows/weekly-developer-announcement.yml index a9faf365a..c21fe5aa2 100644 --- a/.github/workflows/weekly-developer-announcement.yml +++ b/.github/workflows/weekly-developer-announcement.yml @@ -4,8 +4,9 @@ on: workflow_dispatch: permissions: - contents: write - pull-requests: write + contents: read + pull-requests: read + copilot-requests: write jobs: generate: @@ -23,4 +24,11 @@ jobs: - name: Generate Weekly Announcement env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: node .github/scripts/generate-announcement.js \ No newline at end of file + run: node .github/scripts/generate-announcement.js + + - name: Test Copilot CLI + run: | + npm install -g @github/copilot + copilot -p "In one sentence, explain what this repository is about." -s --no-ask-user + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 2d65276fc68d66a109b35bc77b6ece8fcc4ec956 Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 11:50:27 +0200 Subject: [PATCH 5/8] Update copilot --- .github/scripts/generate-announcement.js | 135 ++++++++++++++---- .../weekly-developer-announcement.yml | 12 +- 2 files changed, 111 insertions(+), 36 deletions(-) diff --git a/.github/scripts/generate-announcement.js b/.github/scripts/generate-announcement.js index 846b593c6..4d0b656e8 100644 --- a/.github/scripts/generate-announcement.js +++ b/.github/scripts/generate-announcement.js @@ -1,4 +1,5 @@ const fs = require("fs"); +const { execFileSync } = require("child_process"); // ====================================================== // Configuration @@ -40,6 +41,95 @@ async function githubGet(url) { } +// ====================================================== +// Copilot Summarization +// ====================================================== + +function summarizePR(pr) { + + const changes = pr.files + .map(file => { + return `File: ${file.filename} +Status: ${file.status} +Changes: +${file.patch || "No patch available."}`; + }) + .join("\n\n"); + + const prompt = ` +You are writing a weekly developer announcement for Shopware developers. + +Analyze this merged documentation PR. + +PR title: +${pr.title} + +PR description: +${pr.body || "No description provided."} + +Changed files: +${changes} + +Write a concise, developer-focused summary. + +Focus on: +- What changed +- What developers need to know +- Why the change matters to developers +- Any API, CLI, migration, compatibility, configuration, or workflow impact + +Rules: +- Write 2-3 sentences only. +- Do not mention the PR number. +- Do not mention that you are an AI. +- Do not reproduce the PR checklist. +- Do not reproduce links or HTML comments. +- Do not simply repeat the PR description. +- Focus on the actual developer impact. +`; + + try { + + const summary = execFileSync( + "copilot", + [ + "-p", + prompt, + "-s", + "--no-ask-user" + ], + { + encoding: "utf8", + maxBuffer: 1024 * 1024 + } + ); + + return summary.trim(); + + } catch (error) { + + console.error( + `Copilot summarization failed for PR #${pr.number}:`, + error.message + ); + + // Fallback to existing summary extraction + if (!pr.body || pr.body.trim() === "") { + return pr.title; + } + + const summaryMatch = pr.body.match( + /## Summary\s*([\s\S]*?)(?=\n## |\n---|$)/i + ); + + if (summaryMatch) { + return summaryMatch[1].trim(); + } + + return pr.body.split("\n")[0].trim(); + } +} + // ====================================================== // Main // ====================================================== @@ -115,43 +205,32 @@ async function githubGet(url) { } //-------------------------------------------------- -// Build Weekly Announcement -//-------------------------------------------------- - -function summarizePR(pr) { - - if (!pr.body || pr.body.trim() === "") { - return pr.title; - } - - const summaryMatch = pr.body.match( - /## Summary\s*([\s\S]*?)(?=\n## |\n---|$)/i - ); + // Build Weekly Announcement + //-------------------------------------------------- - if (summaryMatch) { - return summaryMatch[1].trim(); - } + let markdown = "# Weekly Developer Announcement\n\n"; - return pr.body.split("\n")[0].trim(); -} + for (const pr of announcementPRs) { -let markdown = "# Weekly Developer Announcement\n\n"; + console.log( + `Generating AI summary for PR #${pr.number}...` + ); -for (const pr of announcementPRs) { + const summary = summarizePR(pr); - markdown += `## ${pr.title}\n\n`; + markdown += `## ${pr.title}\n\n`; - markdown += `${summarizePR(pr)}\n\n`; + markdown += `${summary}\n\n`; - markdown += "---\n\n"; + markdown += "---\n\n"; -} + } -//-------------------------------------------------- -// Print announcement -//-------------------------------------------------- + //-------------------------------------------------- + // Print announcement + //-------------------------------------------------- -console.log(""); -console.log(markdown); + console.log(""); + console.log(markdown); })(); \ No newline at end of file diff --git a/.github/workflows/weekly-developer-announcement.yml b/.github/workflows/weekly-developer-announcement.yml index c21fe5aa2..657c9da35 100644 --- a/.github/workflows/weekly-developer-announcement.yml +++ b/.github/workflows/weekly-developer-announcement.yml @@ -21,14 +21,10 @@ jobs: with: node-version: 20 + - name: Setup Copilot CLI + run: npm install -g @github/copilot + - name: Generate Weekly Announcement env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: node .github/scripts/generate-announcement.js - - - name: Test Copilot CLI - run: | - npm install -g @github/copilot - copilot -p "In one sentence, explain what this repository is about." -s --no-ask-user - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + run: node .github/scripts/generate-announcement.js \ No newline at end of file From 448f138eec6e8233f57d27113cad6bac0ad5eb7d Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 12:51:58 +0200 Subject: [PATCH 6/8] announcement file download --- .github/scripts/generate-announcement.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/scripts/generate-announcement.js b/.github/scripts/generate-announcement.js index 4d0b656e8..a6a08ce34 100644 --- a/.github/scripts/generate-announcement.js +++ b/.github/scripts/generate-announcement.js @@ -233,4 +233,16 @@ Rules: console.log(""); console.log(markdown); + //-------------------------------------------------- + // Write announcement file + //-------------------------------------------------- + + fs.writeFileSync( + "announcement.md", + markdown, + "utf8" + ); + + console.log("announcement.md generated."); + })(); \ No newline at end of file From d50f229ecdb8c0598cb07dfe74a77dbbb876770d Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 12:56:11 +0200 Subject: [PATCH 7/8] downloable artifact --- .github/scripts/generate-announcement.js | 21 +++++++++++++------ .../weekly-developer-announcement.yml | 8 ++++++- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/scripts/generate-announcement.js b/.github/scripts/generate-announcement.js index a6a08ce34..2cb36ae95 100644 --- a/.github/scripts/generate-announcement.js +++ b/.github/scripts/generate-announcement.js @@ -14,6 +14,12 @@ const event = JSON.parse( const owner = event.repository.owner.login; const repo = event.repository.name; +// ====================================================== +// GitHub API +// ====================================================== + +const API = `https://api.github.com/repos/${owner}/${repo}`; + const headers = { Authorization: `Bearer ${token}`, Accept: "application/vnd.github+json" @@ -38,7 +44,6 @@ async function githubGet(url) { } return response.json(); - } // ====================================================== @@ -113,7 +118,7 @@ Rules: error.message ); - // Fallback to existing summary extraction + // Fallback if (!pr.body || pr.body.trim() === "") { return pr.title; } @@ -173,11 +178,11 @@ Rules: const prNumber = item.number; const pr = await githubGet( - `https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}` + `${API}/pulls/${prNumber}` ); const files = await githubGet( - `https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}/files` + `${API}/pulls/${prNumber}/files` ); announcementPRs.push({ @@ -234,7 +239,7 @@ Rules: console.log(markdown); //-------------------------------------------------- - // Write announcement file + // Create downloadable file //-------------------------------------------------- fs.writeFileSync( @@ -243,6 +248,10 @@ Rules: "utf8" ); - console.log("announcement.md generated."); + console.log(""); + console.log("=========================================="); + console.log("Announcement file generated successfully"); + console.log("=========================================="); + console.log("File: announcement.md"); })(); \ No newline at end of file diff --git a/.github/workflows/weekly-developer-announcement.yml b/.github/workflows/weekly-developer-announcement.yml index 657c9da35..fc918e9b4 100644 --- a/.github/workflows/weekly-developer-announcement.yml +++ b/.github/workflows/weekly-developer-announcement.yml @@ -27,4 +27,10 @@ jobs: - name: Generate Weekly Announcement env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: node .github/scripts/generate-announcement.js \ No newline at end of file + run: node .github/scripts/generate-announcement.js + + - name: Upload Announcement + uses: actions/upload-artifact@v4 + with: + name: weekly-developer-announcement + path: announcement.md \ No newline at end of file From 759e296e6a87e69219d1ad4292c8d3eb1ee40c15 Mon Sep 17 00:00:00 2001 From: sushmangupta Date: Tue, 18 Aug 2026 13:01:03 +0200 Subject: [PATCH 8/8] update file verification --- .github/workflows/weekly-developer-announcement.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/weekly-developer-announcement.yml b/.github/workflows/weekly-developer-announcement.yml index fc918e9b4..749386d5b 100644 --- a/.github/workflows/weekly-developer-announcement.yml +++ b/.github/workflows/weekly-developer-announcement.yml @@ -29,8 +29,16 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: node .github/scripts/generate-announcement.js + - name: Verify announcement file + run: | + echo "Checking generated file..." + ls -la announcement.md + echo "File size:" + wc -c announcement.md + - name: Upload Announcement uses: actions/upload-artifact@v4 with: name: weekly-developer-announcement - path: announcement.md \ No newline at end of file + path: announcement.md + if-no-files-found: error \ No newline at end of file