diff --git a/.ddev/commands/host/npm b/.ddev/commands/host/npm deleted file mode 100755 index 8ac7f5a..0000000 --- a/.ddev/commands/host/npm +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -## Description: Run npm inside the web container in the root of the project (Use --cwd for another directory) -## Usage: npm [flags] [args] -## Example: "ddev npm install" or "ddev npm add learna" or "ddev npm --cwd web/core add learna" - -ddev exec --raw bash -ic "npm $*" -ddev mutagen sync 2>/dev/null diff --git a/.ddev/config.yaml b/.ddev/config.yaml index 138aed9..35e9306 100644 --- a/.ddev/config.yaml +++ b/.ddev/config.yaml @@ -1,203 +1,16 @@ -name: commit-message-checker -type: php +type: generic docroot: "" -php_version: "7.4" webserver_type: nginx-fpm -router_http_port: "80" -router_https_port: "443" xdebug_enabled: false additional_hostnames: [] additional_fqdns: [] -database: - type: mariadb - version: "10.3" -nfs_mount_enabled: false -mutagen_enabled: false hooks: - post-start: - - exec: npm install -omit_containers: [db, dba, ddev-ssh-agent] + post-start: + - exec: npm install +omit_containers: [db, ddev-ssh-agent] use_dns_when_possible: true composer_version: "" web_environment: [] -nodejs_version: "16" - -# Key features of ddev's config.yaml: - -# name: # Name of the project, automatically provides -# http://projectname.ddev.site and https://projectname.ddev.site - -# type: # drupal6/7/8, backdrop, typo3, wordpress, php - -# docroot: # Relative path to the directory containing index.php. - -# php_version: "7.4" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1" - -# You can explicitly specify the webimage but this -# is not recommended, as the images are often closely tied to ddev's' behavior, -# so this can break upgrades. - -# webimage: # nginx/php docker image. - -# database: -# type: # mysql, mariadb -# version: # database version, like "10.3" or "8.0" -# Note that mariadb_version or mysql_version from v1.18 and earlier -# will automatically be converted to this notation with just a "ddev config --auto" - -# router_http_port: # Port to be used for http (defaults to port 80) -# router_https_port: # Port for https (defaults to 443) - -# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart" -# Note that for most people the commands -# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better, -# as leaving xdebug enabled all the time is a big performance hit. - -# xhprof_enabled: false # Set to true to enable xhprof and "ddev start" or "ddev restart" -# Note that for most people the commands -# "ddev xhprof" to enable xhprof and "ddev xhprof off" to disable it work better, -# as leaving xhprof enabled all the time is a big performance hit. - -# webserver_type: nginx-fpm # or apache-fpm - -# timezone: Europe/Berlin -# This is the timezone used in the containers and by PHP; -# it can be set to any valid timezone, -# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones -# For example Europe/Dublin or MST7MDT - -# composer_version: "2" -# if composer_version:"2" it will use the most recent composer v2 -# It can also be set to "1", to get most recent composer v1 -# or "" for the default v2 created at release time. -# It can be set to any existing specific composer version. -# After first project 'ddev start' this will not be updated until it changes - -# nodejs_version: "16" -# change from the default system Node.js version to another supported version, like 12, 14, 17. -# Note that you can use 'ddev nvm' or nvm inside the web container to provide nearly any -# Node.js version, including v6, etc. - -# additional_hostnames: -# - somename -# - someothername -# would provide http and https URLs for "somename.ddev.site" -# and "someothername.ddev.site". - -# additional_fqdns: -# - example.com -# - sub1.example.com -# would provide http and https URLs for "example.com" and "sub1.example.com" -# Please take care with this because it can cause great confusion. - -# upload_dir: custom/upload/dir -# would set the destination path for ddev import-files to /custom/upload/dir - -# working_dir: -# web: /var/www/html -# db: /home -# would set the default working directory for the web and db services. -# These values specify the destination directory for ddev ssh and the -# directory in which commands passed into ddev exec are run. - -# omit_containers: [db, dba, ddev-ssh-agent] -# Currently only these containers are supported. Some containers can also be -# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit -# the "db" container, several standard features of ddev that access the -# database container will be unusable. In the global configuration it is also -# possible to omit ddev-router, but not here. - -# nfs_mount_enabled: false -# Great performance improvement but requires host configuration first. -# See https://ddev.readthedocs.io/en/stable/users/performance/#using-nfs-to-mount-the-project-into-the-container - -# mutagen_enabled: false -# Experimental performance improvement using mutagen asynchronous updates. -# See https://ddev.readthedocs.io/en/latest/users/performance/#using-mutagen - -# fail_on_hook_fail: False -# Decide whether 'ddev start' should be interrupted by a failing hook - -# host_https_port: "59002" -# The host port binding for https can be explicitly specified. It is -# dynamic unless otherwise specified. -# This is not used by most people, most people use the *router* instead -# of the localhost port. - -# host_webserver_port: "59001" -# The host port binding for the ddev-webserver can be explicitly specified. It is -# dynamic unless otherwise specified. -# This is not used by most people, most people use the *router* instead -# of the localhost port. - -# host_db_port: "59002" -# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic -# unless explicitly specified. - -# phpmyadmin_port: "8036" -# phpmyadmin_https_port: "8037" -# The PHPMyAdmin ports can be changed from the default 8036 and 8037 - -# host_phpmyadmin_port: "8036" -# The phpmyadmin (dba) port is not normally bound on the host at all, instead being routed -# through ddev-router, but it can be specified and bound. - -# mailhog_port: "8025" -# mailhog_https_port: "8026" -# The MailHog ports can be changed from the default 8025 and 8026 - -# host_mailhog_port: "8025" -# The mailhog port is not normally bound on the host at all, instead being routed -# through ddev-router, but it can be bound directly to localhost if specified here. - -# webimage_extra_packages: [php7.4-tidy, php-bcmath] -# Extra Debian packages that are needed in the webimage can be added here - -# dbimage_extra_packages: [telnet,netcat] -# Extra Debian packages that are needed in the dbimage can be added here - -# use_dns_when_possible: true -# If the host has internet access and the domain configured can -# successfully be looked up, DNS will be used for hostname resolution -# instead of editing /etc/hosts -# Defaults to true - -# project_tld: ddev.site -# The top-level domain used for project URLs -# The default "ddev.site" allows DNS lookup via a wildcard -# If you prefer you can change this to "ddev.local" to preserve -# pre-v1.9 behavior. - -# ngrok_args: --subdomain mysite --auth username:pass -# Provide extra flags to the "ngrok http" command, see -# https://ngrok.com/docs#http or run "ngrok http -h" - -# disable_settings_management: false -# If true, ddev will not create CMS-specific settings files like -# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php -# In this case the user must provide all such settings. - -# You can inject environment variables into the web container with: -# web_environment: -# - SOMEENV=somevalue -# - SOMEOTHERENV=someothervalue - -# no_project_mount: false -# (Experimental) If true, ddev will not mount the project into the web container; -# the user is responsible for mounting it manually or via a script. -# This is to enable experimentation with alternate file mounting strategies. -# For advanced users only! - -# bind_all_interfaces: false -# If true, host ports will be bound on all network interfaces, -# not just the localhost interface. This means that ports -# will be available on the local network if the host firewall -# allows it. - -# Many ddev commands can be extended to run tasks before or after the -# ddev command is executed, for example "post-start", "post-import-db", -# "pre-composer", "post-composer" -# See https://ddev.readthedocs.io/en/stable/users/extending-commands/ for more -# information on the commands that can be extended and the tasks you can define -# for them. Example: -#hooks: +nodejs_version: auto +corepack_enable: false +ddev_version_constraint: '>= v1.24.10' diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f1c68b8..0000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -dist/ -lib/ -node_modules/ -src/@types/ diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 2421732..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "plugins": ["jest", "@typescript-eslint"], - "extends": ["plugin:github/recommended"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module", - "project": "./tsconfig.json" - }, - "rules": { - "i18n-text/no-en": "off", - "eslint-comments/no-use": "off", - "import/no-namespace": "off", - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], - "@typescript-eslint/no-require-imports": "error", - "@typescript-eslint/array-type": "error", - "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/ban-ts-comment": "error", - "camelcase": "off", - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], - "@typescript-eslint/func-call-spacing": ["error", "never"], - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "error", - "@typescript-eslint/no-extraneous-class": "error", - "@typescript-eslint/no-for-in-array": "error", - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-non-null-assertion": "warn", - "@typescript-eslint/no-unnecessary-qualifier": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/no-useless-constructor": "error", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-for-of": "warn", - "@typescript-eslint/prefer-function-type": "warn", - "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/prefer-string-starts-ends-with": "error", - "@typescript-eslint/promise-function-async": "error", - "@typescript-eslint/require-array-sort-compare": "error", - "@typescript-eslint/restrict-plus-operands": "error", - "semi": "off", - "@typescript-eslint/semi": ["error", "never"], - "@typescript-eslint/type-annotation-spacing": "error", - "@typescript-eslint/unbound-method": "error" - }, - "env": { - "node": true, - "es6": true, - "jest/globals": true - } -} diff --git a/.gitattributes b/.gitattributes index 514de3d..6ba5456 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,3 @@ -# Enforce checkout with linux lf consistent over all plattforms -*.js text eol=lf -*.json text eol=lf -*.ts text eol=lf -*.yml text eol=lf +* text=auto eol=lf + +dist/** -diff linguist-generated=true diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 06c48cd..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: gilbertsoft -custom: https://paypal.me/SGilli diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index f7014c8..caf4526 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,21 +1,23 @@ name: 🐞 Bug report description: Create a report to help us improve. labels: [bug] -assignees: - - gilbertsoft body: - type: checkboxes id: terms attributes: label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/GsActions/commit-message-checker/blob/main/CODE_OF_CONDUCT.md). + description: + By submitting this issue, you agree to follow our [Code of + Conduct](https://github.com/ddev/.github/blob/main/CODE_OF_CONDUCT.md). options: - label: I agree to follow this project's Code of Conduct required: true - type: checkboxes attributes: label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the bug you encountered. + description: + Please search to see if an issue already exists for the bug you + encountered. options: - label: I have searched the existing issues required: true @@ -27,15 +29,16 @@ body: multiple: false options: - ubuntu-latest - - ubuntu-20.04 - - ubuntu-18.04 + - ubuntu-24.04 + - ubuntu-22.04 - windows-latest + - windows-2025 - windows-2022 - - windows-2019 - - windows-2016 - macos-latest - - macos-11 - - macos-10.15 + - macos-15 + - macos-14 + - macos-13 + - Self-hosted - Other (please describe below) validations: required: true @@ -43,7 +46,9 @@ body: id: other-runner attributes: label: Additional runner information - description: Please provide more information about the used runner if you selected `Other` above. + description: + Please provide more information about the used runner if you selected + `Other` above. validations: required: false - type: textarea diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index d64f01b..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: 🚑 Community support - url: https://github.com/GsActions/commit-message-checker/discussions - about: Please ask and answer questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 557bd10..a177088 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,21 +1,23 @@ name: 🚀 Feature request description: Suggest an idea for this project. labels: [enhancement] -assignees: - - gilbertsoft body: - type: checkboxes id: terms attributes: label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/GsActions/commit-message-checker/blob/main/CODE_OF_CONDUCT.md). + description: + By submitting this issue, you agree to follow our [Code of + Conduct](https://github.com/ddev/.github/blob/main/CODE_OF_CONDUCT.md). options: - label: I agree to follow this project's Code of Conduct required: true - type: checkboxes attributes: label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the feature you request. + description: + Please search to see if an issue already exists for the feature you + request. options: - label: I have searched the existing issues required: true @@ -23,14 +25,18 @@ body: id: sponsoring attributes: label: Are you willing to sponsor your idea? - description: Supporting a proposal can speed up the development of your idea and you can also better influence the final solution. + description: + Supporting a proposal can speed up the development of your idea and you + can also better influence the final solution. options: - label: Yes, I like to sponsor this request required: false - type: textarea attributes: label: Is your feature request related to a problem? Please describe - description: A clear and concise description of what the problem is. Ex. I'm always frustrated when... + description: + A clear and concise description of what the problem is. Ex. I'm always + frustrated when... validations: required: true - type: textarea @@ -42,12 +48,15 @@ body: - type: textarea attributes: label: Describe alternatives you've considered - description: A clear and concise description of any alternative solutions or features you've considered. + description: + A clear and concise description of any alternative solutions or features + you've considered. validations: required: false - type: textarea attributes: label: Additional context - description: Add any other context or screenshots about the feature request here. + description: + Add any other context or screenshots about the feature request here. validations: required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..c7511c3 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +## The Issue + +- Fixes #REPLACE_ME_WITH_RELATED_ISSUE_NUMBER + + + +## How This PR Solves The Issue + + + +## Manual Testing Instructions + + + +## Automated Testing Overview + + + +## Release/Deployment Notes + + diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 120000 index 0000000..be77ac8 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1 @@ +../AGENTS.md \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddc7500 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + retag-major: + name: Move major-version tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Move major tag + env: + TAG: ${{ github.event.release.tag_name }} + run: | + if [[ ! "$TAG" =~ ^(v[0-9]+)\.[0-9]+\.[0-9]+$ ]]; then + echo "Tag $TAG is not in vX.Y.Z format; skipping major-tag update." + exit 1 + fi + major="${BASH_REMATCH[1]}" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag -f "$major" "$TAG" + git push origin "$major" --force diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a4c6da..ad878cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: "build-test" +name: 'build-test' on: # rebuild any PRs and main branch changes pull_request: push: @@ -10,11 +10,11 @@ jobs: build: # make sure build/ci work properly runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set Node.js 16.x - uses: actions/setup-node@v3 + - uses: actions/checkout@v6 + - name: Set Node.js 24.x + uses: actions/setup-node@v6 with: - node-version: 16.x + node-version: 24.x - name: Install run: | npm install @@ -29,7 +29,7 @@ jobs: test: # make sure the action works on a clean machine without building runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - uses: ./ with: pattern: '\[(BUGFIX|DOCS|FEATURE|TASK)\] .+$' diff --git a/.gitignore b/.gitignore index e1969dc..6afc0a3 100644 --- a/.gitignore +++ b/.gitignore @@ -94,9 +94,5 @@ typings/ .DS_Store Thumbs.db -# Ignore built ts files -__tests__/runner/* -lib/**/* - # Ignore IDE related files and folders .idea diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..5bf4400 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +24.15.0 diff --git a/.prettierignore b/.prettierignore index 6de9a76..aef7a3f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,7 @@ +.claude/ +.ddev/ +.idea/ +coverage/ dist/ -lib/ node_modules/ +package-lock.json diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index c34bafc..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "semi": false, - "singleQuote": true, - "trailingComma": "none", - "bracketSpacing": false, - "arrowParens": "avoid" -} diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..49c9385 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,16 @@ +# See: https://prettier.io/docs/en/configuration + +printWidth: 80 +tabWidth: 2 +useTabs: false +semi: false +singleQuote: true +quoteProps: as-needed +jsxSingleQuote: false +trailingComma: none +bracketSpacing: true +bracketSameLine: true +arrowParens: always +proseWrap: always +htmlWhitespaceSensitivity: css +endOfLine: lf diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..404d2af --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,97 @@ +# Agent guidelines + +This GitHub Action checks commit messages against a regex pattern. It is written +in TypeScript and bundled to JavaScript via Rollup; both source and bundle are +committed. + +`CLAUDE.md` and `.github/copilot-instructions.md` are symlinks to this file so +Claude Code and GitHub Copilot pick up the same guidance. + +## Repository layout + +| Path | Description | +| ------------------- | ------------------------------------------------------ | +| `src/` | TypeScript source. | +| `dist/` | Generated JavaScript bundle (committed; do not edit). | +| `__fixtures__/` | Jest mocks for `@actions/core` and `@actions/github`. | +| `__tests__/` | Unit tests. | +| `local-action/` | `@github/local-action` env and event payload examples. | +| `.ddev/` | DDEV configuration (Node pinned via `.node-version`). | +| `.github/` | Workflows and issue templates. | +| `action.yml` | GitHub Action metadata and inputs. | +| `eslint.config.mjs` | ESLint flat config. | +| `jest.config.js` | Jest config (ESM via ts-jest). | +| `rollup.config.ts` | Rollup bundler config. | +| `tsconfig.json` | TypeScript config. | +| `.prettierrc.yml` | Prettier config. | +| `.node-version` | Pinned Node version. | + +## Development environment + +All Node tooling runs inside the DDEV web container. Use `ddev npm` and +`ddev exec node`/`npx` — never the host binaries. Node version is pinned via +`.node-version` and surfaced into the container by `nodejs_version: auto` in +`.ddev/config.yaml`. + +```sh +ddev start +ddev npm install +``` + +## Scripts + +| Script | Purpose | +| -------------- | --------------------------------------------------------- | +| `format:write` | Prettier across the repo. | +| `format:check` | Prettier in check mode (CI). | +| `lint` | ESLint over the repo. | +| `test` | Jest in ESM mode (`--experimental-vm-modules`). | +| `package` | Bundle `src/index.ts` → `dist/index.js` via Rollup. | +| `local-action` | Run the action locally against `local-action/.env`. | +| `all` | `format:write` → `lint` → `test` → `package`. Matches CI. | + +Invoke any of these as `ddev npm run