Skip to content

[!!!][TASK] Modernize toolchain onto actions/typescript-action template#2

Merged
stasadev merged 1 commit into
mainfrom
20260526_stasadev_node24
May 26, 2026
Merged

[!!!][TASK] Modernize toolchain onto actions/typescript-action template#2
stasadev merged 1 commit into
mainfrom
20260526_stasadev_node24

Conversation

@stasadev
Copy link
Copy Markdown
Member

The Issue

The action's toolchain was frozen at the state of the upstream fork (GsActions/commit-message-checker) when it went unmaintained: Node 16, ncc bundler, legacy ESLint config, CommonJS Jest, no local-action support. The setup no longer matches the actions/typescript-action template that GitHub maintains as the recommended baseline.

How This PR Solves The Issue

  • Bumps runtime to Node 24 (.node-version, action.yml runs.using: node24, nodejs_version: auto in .ddev/config.yaml).
  • Switches to ESM end-to-end (package.json "type": "module", .js import suffixes in TS, ts-jest ESM preset with --experimental-vm-modules).
  • Replaces ncc with Rollup (rollup.config.ts); dist/index.js regenerated with a source map.
  • Migrates ESLint to flat config (eslint.config.mjs); moves Prettier config to YAML (.prettierrc.yml).
  • Adopts @github/local-action for local dev (local-action/.env.example, local-action/event.json.example).
  • Consolidates Jest mocks into __fixtures__/{core,github}.ts; rewrites tests around jest.unstable_mockModule.
  • Marks dist/ as linguist-generated in .gitattributes so GitHub collapses the bundle diff.
  • Adds a release workflow that auto-points the major-version tag (v3 to v3.0.x) on every published release.
  • Adds AGENTS.md (canonical) with CLAUDE.md and .github/copilot-instructions.md as symlinks so AI assistants share the same project guidance.
  • Updates LICENSE to carry both the original Gilbertsoft and the DDEV Foundation copyright lines; preserves "forked from GsActions" credit in README.md and every src/*.ts header.
  • Fixes action.yml accessToken which previously defaulted to the literal string "false".
  • Refreshes .github/ISSUE_TEMPLATE/bug_report.yml runner list (drops retired Ubuntu 18.04/20.04, Windows 2016/2019, macOS 10.15/11; adds current options and Self-hosted).
  • Drops .github/FUNDING.yml, CODE_OF_CONDUCT.md, and .github/ISSUE_TEMPLATE/config.yml (community resources now live under the DDEV Foundation org).

Manual Testing Instructions

  • ddev start && ddev npm install
  • ddev npm run all (format, lint, test, build) should be clean.
  • ddev npm run local-action exercises src/main.ts against local-action/.env and local-action/event.json (auto-copied from the .example files on first run).

Automated Testing Overview

  • Existing Jest suite ported to ESM; covers regex pass/fail paths and input/payload error conditions in __tests__/commit-message-checker.test.ts and __tests__/input-helper.test.ts.
  • CI (.github/workflows/test.yml) installs, runs npm run all, and fails the PR if dist/ is dirty after a rebuild.

Release/Deployment Notes

  • Bumps the required Node runtime from 16 to 24. GitHub-hosted runners have shipped Node 24 since 2025-09; consumers pinning via ddev/commit-message-checker@v3 need no workflow changes.
  • The first release after this merge (e.g. v3.0.0) will trigger release.yml, which creates the v3 major-version tag and keeps it current for subsequent patch releases.

## The Issue

The action's toolchain was frozen at the state of the upstream fork
(GsActions/commit-message-checker) when it went unmaintained: Node 16,
ncc bundler, legacy ESLint config, CommonJS Jest, no local-action
support. The setup no longer matches the actions/typescript-action
template that GitHub maintains as the recommended baseline.

## How This PR Solves The Issue

- Bumps runtime to Node 24 (`.node-version`, `action.yml runs.using:
  node24`, `nodejs_version: auto` in `.ddev/config.yaml`).
- Switches to ESM end-to-end (`package.json "type": "module"`, `.js`
  import suffixes in TS, ts-jest ESM preset with
  `--experimental-vm-modules`).
- Replaces ncc with Rollup (`rollup.config.ts`); `dist/index.js`
  regenerated with a source map.
- Migrates ESLint to flat config (`eslint.config.mjs`); moves Prettier
  config to YAML (`.prettierrc.yml`).
- Adopts `@github/local-action` for local dev (`local-action/.env.example`,
  `local-action/event.json.example`).
- Consolidates Jest mocks into `__fixtures__/{core,github}.ts`; rewrites
  tests around `jest.unstable_mockModule`.
- Marks `dist/` as `linguist-generated` in `.gitattributes` so GitHub
  collapses the bundle diff.
- Adds a release workflow that auto-points the major-version tag
  (`v3` to `v3.0.x`) on every published release.
- Adds `AGENTS.md` (canonical) with `CLAUDE.md` and
  `.github/copilot-instructions.md` as symlinks so AI assistants share
  the same project guidance.
- Updates `LICENSE` to carry both the original Gilbertsoft and the DDEV
  Foundation copyright lines; preserves "forked from GsActions" credit
  in `README.md` and every `src/*.ts` header.
- Fixes `action.yml` `accessToken` which previously defaulted to the
  literal string `"false"`.
- Refreshes `.github/ISSUE_TEMPLATE/bug_report.yml` runner list (drops
  retired Ubuntu 18.04/20.04, Windows 2016/2019, macOS 10.15/11; adds
  current options and `Self-hosted`).
- Drops `.github/FUNDING.yml`, `CODE_OF_CONDUCT.md`, and
  `.github/ISSUE_TEMPLATE/config.yml` (community resources now live
  under the DDEV Foundation org).

## Manual Testing Instructions

- `ddev start && ddev npm install`
- `ddev npm run all` (format, lint, test, build) should be clean.
- `ddev npm run local-action` exercises `src/main.ts` against
  `local-action/.env` and `local-action/event.json` (auto-copied from
  the `.example` files on first run).

## Automated Testing Overview

- Existing Jest suite ported to ESM; covers regex pass/fail paths and
  input/payload error conditions in
  `__tests__/commit-message-checker.test.ts` and
  `__tests__/input-helper.test.ts`.
- CI (`.github/workflows/test.yml`) installs, runs `npm run all`, and
  fails the PR if `dist/` is dirty after a rebuild.

## Release/Deployment Notes

- Bumps the required Node runtime from 16 to 24. GitHub-hosted runners
  have shipped Node 24 since 2025-09; consumers pinning via
  `ddev/commit-message-checker@v3` need no workflow changes.
- The first release after this merge (e.g. `v3.0.0`) will trigger
  `release.yml`, which creates the `v3` major-version tag and keeps it
  current for subsequent patch releases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@stasadev
Copy link
Copy Markdown
Member Author

v2.0.0 was never going to work, because we cannot publish it to Marketplace with the same name.

This is going to be v3.0.0, and I'll test it in ddev/ddev.

@stasadev stasadev merged commit a60e39f into main May 26, 2026
2 checks passed
@stasadev stasadev deleted the 20260526_stasadev_node24 branch May 26, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant