Skip to content

ci: update of files from global .github repo#5364

Merged
asyncapi-bot merged 1 commit into
masterfrom
bot/update-files-from-global-repo
Apr 25, 2026
Merged

ci: update of files from global .github repo#5364
asyncapi-bot merged 1 commit into
masterfrom
bot/update-files-from-global-repo

Conversation

@asyncapi-bot
Copy link
Copy Markdown
Contributor

@asyncapi-bot asyncapi-bot commented Apr 25, 2026

Summary by CodeRabbit

Release Notes

  • Infrastructure Updates

    • Upgraded automated notification workflows from Node.js 16 to Node.js 20 for enhanced performance and security updates.
    • Migrated notification delivery system to provide reliable email communication for member notifications.
  • Bug Fixes

    • Fixed step label in discussion notification workflow to accurately reflect operation.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 25, 2026

Deploy Preview for asyncapi-website ready!

Name Link
🔨 Latest commit 2ade6dd
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/69ec83a2ff9f820008a376d8
😎 Deploy Preview https://deploy-preview-5364--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Walkthrough

This pull request migrates GitHub Actions notification workflows from Mailchimp to Kit.com for TSC member email notifications. It updates Node.js runtime to version 20, introduces new Kit integration scripts with email validation and HTML generation, removes deprecated Mailchimp modules, and corrects a Slack notification step name.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/notify-tsc-members-mention.yml
Updated all jobs to Node.js 20, replaced Mailchimp environment variables with Kit API credentials (KIT_API_KEY, KIT_TSC_TAG_ID), changed working directory and script invocation from Mailchimp to Kit module, modified GitHub Script to return result instead of fire-and-forget execution, and corrected step label in discussion job.
Kit.com Integration Scripts
.github/workflows/scripts/kit/index.js, .github/workflows/scripts/kit/htmlContent.js, .github/workflows/scripts/kit/package.json
New Kit integration: async function validates link/title input, computes scheduled send timestamp (+1 min), constructs broadcast payload with sanitized HTML content, calls Kit API, and reports status via GitHub Actions core API; HTML template generator escapes special characters to prevent XSS.
Mailchimp Removal
.github/workflows/scripts/mailchimp/index.js, .github/workflows/scripts/mailchimp/package.json
Deleted Mailchimp integration module including campaign creation, scheduling, and SDK configuration; removed package dependencies on @mailchimp/mailchimp_marketing and @actions/core.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Webhook
    participant WF as Workflow Runner
    participant Script as Kit Integration Script
    participant Kit as Kit.com API
    participant Core as GitHub Actions Core

    GH->>WF: Trigger workflow<br/>(issue/PR/discussion event)
    WF->>Script: Execute script<br/>(link, title)
    Script->>Script: Validate link (HTTPS)<br/>& sanitize title
    Script->>Script: Generate HTML email<br/>with XSS escaping
    Script->>Script: Calculate send_at<br/>(now + 1 min)
    Script->>Kit: POST broadcast payload<br/>(API key, subject, HTML, tag)
    alt API Success
        Kit-->>Script: 200 OK + scheduled time
        Script->>Core: core.info(success message)
    else API Failure
        Kit-->>Script: Error response
        Script->>Core: core.setFailed(error)
    end
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Poem

🐰 From Mailchimp's halls to Kit's bright domain,
Our TSC emails find a new lane,
With Node twenty running, XSS kept at bay,
HTML templates sanitized with care—hooray!
✉️ The migration hops forward, secure and clean.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'ci: update of files from global .github repo' is vague and generic, failing to describe the specific, substantial changes made in this pull request. Use a more descriptive title that highlights the main change, such as 'ci: migrate TSC notification system from Mailchimp to Kit.com' to clearly communicate the primary objective of this changeset.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bot/update-files-from-global-repo

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 and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@asyncapi-bot
Copy link
Copy Markdown
Contributor Author

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 48
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-5364--asyncapi-website.netlify.app/

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/scripts/kit/index.js:
- Around line 35-58: The code uses TSC_TAG_ID =
Number(process.env.KIT_TSC_TAG_ID) which can be NaN and will serialize
incorrectly into subscriber_filter, and the fetch has no timeout; fix by
validating KIT_TSC_TAG_ID after reading it (e.g., parseInt/Number and if
!Number.isInteger(TSC_TAG_ID) or isNaN throw/log and exit) so the function does
not continue with an invalid tag id (reference TSC_TAG_ID and subscriber_filter
in the POST body), and add an AbortController with a short configurable timeout
(create controller, setTimeout to controller.abort after e.g. 10s, pass
controller.signal into the fetch call and clear the timer on success) so the
fetch to KIT_BASE/broadcasts cannot hang the runner.
- Around line 8-40: sanitizeLinkAndTitle currently calls core.setFailed and
returns its value (undefined), causing the caller to destructure undefined and
throw a misleading TypeError; change sanitizeLinkAndTitle to throw new
Error(...) (with descriptive messages) instead of returning core.setFailed, and
in the caller (the exported async function where you call sanitizeLinkAndTitle)
wrap the call in a try-catch that catches the thrown Error, calls
core.setFailed(err.message) and exits/returns early so the rest of the function
does not run with invalid data. Ensure you reference sanitizeLinkAndTitle for
the throw changes and the exported async function (the module.exports wrapper
that destructures { sanitizedLink, sanitizedTitle }) for the try-catch handling.

In @.github/workflows/scripts/kit/package.json:
- Around line 5-7: Update the pinned `@actions/core` version in package.json from
"1.6.0" to a conservative caret range "^2.0.3" to pick up Node 24 support and
security fixes while avoiding the ESM-only 3.x breaking change; edit the
"dependencies" entry for "@actions/core", run your package manager
(npm/yarn/pnpm) to restore lockfile, and run the test/build workflow to verify
compatibility (look for the "@actions/core" dependency entry in the JSON to
locate the change).
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a2b6253f-4ea0-495c-9104-d8b31b8eb029

📥 Commits

Reviewing files that changed from the base of the PR and between 1dd5d7c and 2ade6dd.

⛔ Files ignored due to path filters (2)
  • .github/workflows/scripts/kit/package-lock.json is excluded by !**/package-lock.json
  • .github/workflows/scripts/mailchimp/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • .github/workflows/notify-tsc-members-mention.yml
  • .github/workflows/scripts/kit/htmlContent.js
  • .github/workflows/scripts/kit/index.js
  • .github/workflows/scripts/kit/package.json
  • .github/workflows/scripts/mailchimp/index.js
  • .github/workflows/scripts/mailchimp/package.json
💤 Files with no reviewable changes (2)
  • .github/workflows/scripts/mailchimp/package.json
  • .github/workflows/scripts/mailchimp/index.js

Comment on lines +8 to +40
const sanitizeLinkAndTitle = (link, title) => {
// Validate inputs to prevent injection attacks
if (!link || typeof link !== 'string' || link.length > 2000) {
return core.setFailed('Invalid link parameter');
}
if (!title || typeof title !== 'string' || title.length > 500) {
return core.setFailed('Invalid title parameter');
}

let parsedLink;
try {
parsedLink = new URL(link);
} catch (error) {
return core.setFailed('Invalid link parameter');
}

if (parsedLink.protocol !== 'https:') {
return core.setFailed('Link must use https protocol');
}

// Sanitize title by removing control characters and limiting length
const sanitizedTitle = title.replace(/[\x00-\x1F\x7F]/g, '').substring(0, 250);
return { sanitizedLink: parsedLink.toString(), sanitizedTitle };
};

module.exports = async (link, title) => {
const KIT_BASE = 'https://api.kit.com/v4';
const TSC_TAG_ID = Number(process.env.KIT_TSC_TAG_ID);

// Schedule 1 minute ahead
const sendAt = new Date(Date.now() + 60 * 1000);

const { sanitizedLink, sanitizedTitle } = sanitizeLinkAndTitle(link, title);
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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Does @actions/core setFailed terminate execution or just set an error and exit code?

💡 Result:

@actions/core's setFailed logs an error message and sets the Node.js process.exitCode to 1 (failure), but does not immediately terminate execution. The process continues running until it naturally exits or process.exit is explicitly called. When the action's main script exits with a non-zero exit code, GitHub Actions marks the step as failed, which cancels concurrent steps and skips subsequent ones in the job.

Citations:


Critical: validation does not terminate — function will destructure undefined and throw a misleading TypeError.

core.setFailed() only sets the exit code and logs an error; it does not stop execution. When validation fails at any of lines 12, 16, or 22, the function "returns" undefined (the return value of core.setFailed). Line 40 then attempts to destructure this undefined, throwing TypeError: Cannot destructure property 'sanitizedLink' of 'undefined'. This masks the actual validation error and, if the error were somehow tolerated, the broadcast would proceed with undefined content.

Use throw new Error() instead of return core.setFailed() inside sanitizeLinkAndTitle, and wrap the call at line 40 in a try-catch to properly catch and report the error.

Proposed fix
 const sanitizeLinkAndTitle = (link, title) => {
   // Validate inputs to prevent injection attacks
     if (!link || typeof link !== 'string' || link.length > 2000) {
-        return core.setFailed('Invalid link parameter');
+        throw new Error('Invalid link parameter');
     }
     if (!title || typeof title !== 'string' || title.length > 500) {
-        return core.setFailed('Invalid title parameter');
+        throw new Error('Invalid title parameter');
     }

     let parsedLink;
     try {
         parsedLink = new URL(link);
     } catch (error) {
-        return core.setFailed('Invalid link parameter');
+        throw new Error('Invalid link parameter');
     }

     if (parsedLink.protocol !== 'https:') {
-        return core.setFailed('Link must use https protocol');
+        throw new Error('Link must use https protocol');
     }

     const sanitizedTitle = title.replace(/[\x00-\x1F\x7F]/g, '').substring(0, 250);
     return { sanitizedLink: parsedLink.toString(), sanitizedTitle };
 };

 module.exports = async (link, title) => {
     const KIT_BASE = 'https://api.kit.com/v4';
     const TSC_TAG_ID = Number(process.env.KIT_TSC_TAG_ID);
     const sendAt = new Date(Date.now() + 60 * 1000);

-    const { sanitizedLink, sanitizedTitle } = sanitizeLinkAndTitle(link, title);
+    let sanitizedLink, sanitizedTitle;
+    try {
+        ({ sanitizedLink, sanitizedTitle } = sanitizeLinkAndTitle(link, title));
+    } catch (err) {
+        return core.setFailed(err.message);
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/scripts/kit/index.js around lines 8 - 40,
sanitizeLinkAndTitle currently calls core.setFailed and returns its value
(undefined), causing the caller to destructure undefined and throw a misleading
TypeError; change sanitizeLinkAndTitle to throw new Error(...) (with descriptive
messages) instead of returning core.setFailed, and in the caller (the exported
async function where you call sanitizeLinkAndTitle) wrap the call in a try-catch
that catches the thrown Error, calls core.setFailed(err.message) and
exits/returns early so the rest of the function does not run with invalid data.
Ensure you reference sanitizeLinkAndTitle for the throw changes and the exported
async function (the module.exports wrapper that destructures { sanitizedLink,
sanitizedTitle }) for the try-catch handling.

Comment on lines +35 to +58
const TSC_TAG_ID = Number(process.env.KIT_TSC_TAG_ID);

// Schedule 1 minute ahead
const sendAt = new Date(Date.now() + 60 * 1000);

const { sanitizedLink, sanitizedTitle } = sanitizeLinkAndTitle(link, title);

const res = await fetch(`${KIT_BASE}/broadcasts`, {
method: 'POST',
headers: {
'X-Kit-Api-Key': process.env.KIT_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
subject: `TSC attention required: ${sanitizedTitle}`,
preview_text: 'Check out the latest topic that TSC members have to be aware of',
content: htmlContent(sanitizedLink, sanitizedTitle),
description: `TSC notification - ${new Date().toUTCString()}`,
public: false,
published_at: null,
send_at: sendAt.toISOString(),
subscriber_filter: [{ all: [{ type: 'tag', ids: [TSC_TAG_ID] }] }]
})
});
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.

⚠️ Potential issue | 🟡 Minor

Validate KIT_TSC_TAG_ID and add a fetch timeout.

Two reliability gaps:

  1. Number(process.env.KIT_TSC_TAG_ID) (line 35) becomes NaN if the secret is missing/misconfigured, then serializes to null inside subscriber_filter, silently broadcasting to the wrong audience (or none) instead of failing loudly.
  2. The fetch to api.kit.com has no timeout/AbortSignal — a hung connection will pin the runner until the job/step timeout.
🛡️ Proposed fix
     const KIT_BASE = 'https://api.kit.com/v4';
-    const TSC_TAG_ID = Number(process.env.KIT_TSC_TAG_ID);
+    const TSC_TAG_ID = Number(process.env.KIT_TSC_TAG_ID);
+    if (!Number.isInteger(TSC_TAG_ID) || TSC_TAG_ID <= 0) {
+        return core.setFailed('KIT_TSC_TAG_ID is missing or not a positive integer');
+    }
+    if (!process.env.KIT_API_KEY) {
+        return core.setFailed('KIT_API_KEY is not set');
+    }
@@
-    const res = await fetch(`${KIT_BASE}/broadcasts`, {
+    const res = await fetch(`${KIT_BASE}/broadcasts`, {
         method: 'POST',
+        signal: AbortSignal.timeout(15000),
         headers: {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/scripts/kit/index.js around lines 35 - 58, The code uses
TSC_TAG_ID = Number(process.env.KIT_TSC_TAG_ID) which can be NaN and will
serialize incorrectly into subscriber_filter, and the fetch has no timeout; fix
by validating KIT_TSC_TAG_ID after reading it (e.g., parseInt/Number and if
!Number.isInteger(TSC_TAG_ID) or isNaN throw/log and exit) so the function does
not continue with an invalid tag id (reference TSC_TAG_ID and subscriber_filter
in the POST body), and add an AbortController with a short configurable timeout
(create controller, setTimeout to controller.abort after e.g. 10s, pass
controller.signal into the fetch call and clear the timer on success) so the
fetch to KIT_BASE/broadcasts cannot hang the runner.

Comment on lines +5 to +7
"dependencies": {
"@actions/core": "1.6.0"
}
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What is the latest stable release of @actions/core on npm?

💡 Result:

The latest stable release of @actions/core on npm is 3.0.0, published on January 29, 2026.

Citations:


🌐 Web query:

@actions/core npm version history release dates 2.x 3.0.0 timeline

💡 Result:

The @actions/core npm package version history, focusing on 2.x and the 3.0.0 release timeline, is as follows based on official npm and GitHub sources: 2.x series (Dec 2025 - Jan 2026): - 2.0.0: Released December 9, 2025. Added Node 24 support (PR #2110) and bumped @actions/http-client to 3.0.0. - 2.0.1: Released December 11, 2025. Bumped @actions/exec to 2.0.0 (PR #2199). - 2.0.2: Released January 8, 2026. - 2.0.3: Released January 27, 2026. Bumped @actions/http-client to 3.0.2. 3.0.0: Released January 29, 2026. Breaking change: ESM-only (no CommonJS support; use dynamic import). Full changelog available in https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md. npm page: https://www.npmjs.com/package/@actions/core (33 versions total since Aug 7, 2019).

Citations:


Bump @actions/core to address version stagnation from 2021.

@actions/core 1.6.0 is from 2021 and is significantly outdated. The package has evolved substantially: version 2.0.3 (stable for 3 months) adds Node 24 support and security improvements while maintaining CommonJS compatibility. Version 3.0.0 (released Jan 29, 2026) introduces a breaking ESM-only change, so ^2.0.3 is the recommended conservative bump.

♻️ Suggested bump
   "dependencies": {
-    "@actions/core": "1.6.0"
+    "@actions/core": "^2.0.3"
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dependencies": {
"@actions/core": "1.6.0"
}
"dependencies": {
"@actions/core": "^2.0.3"
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/scripts/kit/package.json around lines 5 - 7, Update the
pinned `@actions/core` version in package.json from "1.6.0" to a conservative
caret range "^2.0.3" to pick up Node 24 support and security fixes while
avoiding the ESM-only 3.x breaking change; edit the "dependencies" entry for
"@actions/core", run your package manager (npm/yarn/pnpm) to restore lockfile,
and run the test/build workflow to verify compatibility (look for the
"@actions/core" dependency entry in the JSON to locate the change).

@asyncapi-bot asyncapi-bot merged commit 468458e into master Apr 25, 2026
37 checks passed
@asyncapi-bot asyncapi-bot deleted the bot/update-files-from-global-repo branch April 25, 2026 09:13
@github-project-automation github-project-automation Bot moved this from To Be Triaged to Done in Website - Kanban Apr 25, 2026
codxbrexx pushed a commit to codxbrexx/website-asyncapi that referenced this pull request May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants