chore: migrate to Node 24 LTS, upgrade dependencies, and resolve environment issues - #1835
Open
Bernard2806 wants to merge 7 commits into
Open
chore: migrate to Node 24 LTS, upgrade dependencies, and resolve environment issues#1835Bernard2806 wants to merge 7 commits into
Bernard2806 wants to merge 7 commits into
Conversation
- Update Dockerfile base image from node:20 to node:24-bookworm-slim - Update GitHub Actions to Node 24 compatible versions: - actions/checkout v3 → v7 - actions/setup-node v3 → v6 - github/codeql-action v2 → v4 - actions/github-script v6 → v7 - actions/labeler v4 → v6 - actions/stale v6 → v10 - dessant/lock-threads v4 → v6 - Update node-version from 20 to 24 in all workflow files - Update npm dependencies for Node 24 compatibility: - puppeteer ^21.2.1 → ^25.0.0 - sharp ^0.32.3 → ^0.35.0 - jsdom ^22.1.0 → ^26.0.0 - eslint ^8.49.0 → ^9.0.0 - @actions/github ^5.1.1 → ^6.0.0 - @octokit/graphql ^7.0.1 → ^8.0.0 - @octokit/rest ^20.0.1 → ^21.0.0 - Fix postinstall script for Puppeteer v25 API changes BREAKING CHANGE: Node 20 is no longer supported (EOL April 2026)
…, and CLI analysis tools
The lines plugin template (`lines.ejs`) was attempting to call `.includes()` on `plugins.lines.sections` at the very beginning of the file, before checking if the plugin had returned an error. If the plugin failed, `sections` was undefined, which resulted in a `TypeError` that crashed the entire rendering process. This commit adds optional chaining (`?.`) to the `sections` property checks on line 1, allowing the template engine to safely bypass the condition when `sections` is missing and properly fall through to the internal `plugins.lines.error` handling block.
Recent versions of Puppeteer require `executablePath` to be an absolute path rather than just the executable name. This changes `PUPPETEER_BROWSER_PATH` from `google-chrome-stable` to `/usr/bin/google-chrome-stable` to resolve the "Browser was not found" error during the action run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR upgrades the project runtime to Node 24 LTS (as Node 20 has reached its End of Life in April 2026), updates GitHub Actions workflows and npm packages to Node 24-compatible versions, and resolves several runtime/build environment issues introduced by the dependency upgrades.
Note
Although this PR modifies Workflow files (normally restricted under
CONTRIBUTING.md) and Core dependencies, these changes are necessary to ensure the project remains compatible with supported Node.js runtimes and avoids security/deprecation issues associated with Node 20 EOL.Why these changes were made
puppeteer,@octokit/*, andsharpwere bumped to prevent deprecation and compatibility issues.libxml2-dev,libxslt1-dev,xz-utils) to allow native compilation of thelicensedRuby gem dependencies.@octokit/restand@octokit/graphqldependencies modified their default ESM export behavior. This required switching from default imports to namespace imports to avoid runtime crashes..includes()onsectionswhich wasundefined./usr/bin/google-chrome-stableinstead ofgoogle-chrome-stable).Detailed Changes
1. Upgrade to Node 24 LTS & Dependency Bumps (Workflows & Core)
node:24-bookworm-slim.24across all.github/workflows/files.actions/checkouttov7,actions/setup-nodetov6,github/codeql-actiontov4).puppeteer,sharp,jsdom,eslint,@actions/github,@octokit/graphql, and@octokit/restin package.json.postinstallscript in package.json to utilizenpx puppeteer browsers install chromematching the new Puppeteer CLI syntax.2. Docker Build & Setup Fixes
libxml2-devandlibxslt1-devdependencies to support compilation of native XML/XSLT libraries for Ruby.xz-utilsto handle.tar.xzextractions during Ruby setup.PUPPETEER_BROWSER_PATHenvironment variable to use the absolute path/usr/bin/google-chrome-stableto prevent execution failure inside the Docker container.3. Namespace Imports for
@octokit(Core ESM compatibility)Updated import statements from default to namespace imports (
import * as ...) to maintain compatibility with@octokit/rest@21and@octokit/graphql@8:4. Template Crash Fix (Templates)
?.) toplugins.lines.sectionson line 1. This prevents aTypeErrorwhen the plugin encounters an error and returnsundefinedforsections, allowing the template to safely handle the fallback error block without crashing the rendering process (visuals remain completely unchanged).