5
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2025-11-07 08:06:54 +00:00

fix: fix backwards compatibility with people using commitlint.config.js

This commit is contained in:
Wagner Santos 2024-03-28 15:54:11 -03:00
parent e15adf3661
commit cae25ddc80
6 changed files with 90 additions and 9 deletions

View file

@ -12,7 +12,7 @@ FROM node:20.9.0-alpine3.17
RUN apk --no-cache add git
COPY --from=build dist/run.mjs /run.mjs
COPY --from=build dist/run.js /run.js
COPY package*.json /

View file

@ -1,5 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
import { maxLineLength } from '@commitlint/ensure'
const { maxLineLength } = require('@commitlint/ensure')
const bodyMaxLineLength = 100
@ -14,7 +14,7 @@ const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => {
]
}
export default {
module.exports = {
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-function-rules'],
rules: {

View file

@ -12,6 +12,4 @@ fi
# Info about the vunlerability: https://github.blog/2022-04-12-git-security-vulnerability-announced/
git config --global --add safe.directory "$GITHUB_WORKSPACE"
export NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules"
node /run.mjs
node /run.js

77
package-lock.json generated
View file

@ -37,6 +37,7 @@
"@jest/globals": "^29.7.0",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^14.1.0",
"babel-jest": "^29.7.0",
"commit-and-tag-version": "^12.2.0",
@ -5623,6 +5624,54 @@
"rollup": "^2.68.0"
}
},
"node_modules/@rollup/plugin-json": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz",
"integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==",
"dev": true,
"dependencies": {
"@rollup/pluginutils": "^5.1.0"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-json/node_modules/@rollup/pluginutils": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz",
"integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==",
"dev": true,
"dependencies": {
"@types/estree": "^1.0.0",
"estree-walker": "^2.0.2",
"picomatch": "^2.3.1"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0"
},
"peerDependenciesMeta": {
"rollup": {
"optional": true
}
}
},
"node_modules/@rollup/plugin-json/node_modules/@types/estree": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
"dev": true
},
"node_modules/@rollup/plugin-node-resolve": {
"version": "14.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-14.1.0.tgz",
@ -21574,6 +21623,34 @@
"resolve": "^1.17.0"
}
},
"@rollup/plugin-json": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz",
"integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^5.1.0"
},
"dependencies": {
"@rollup/pluginutils": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz",
"integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==",
"dev": true,
"requires": {
"@types/estree": "^1.0.0",
"estree-walker": "^2.0.2",
"picomatch": "^2.3.1"
}
},
"@types/estree": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
"dev": true
}
}
},
"@rollup/plugin-node-resolve": {
"version": "14.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-14.1.0.tgz",

View file

@ -3,7 +3,7 @@
"version": "5.4.6",
"description": "commitlint github action",
"private": true,
"module": "./dist/run.mjs",
"main": "./dist/run.mjs",
"scripts": {
"postinstall": "husky install",
"test": "NODE_PATH=./node_modules NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest",
@ -49,6 +49,7 @@
"@jest/globals": "^29.7.0",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^14.1.0",
"babel-jest": "^29.7.0",
"commit-and-tag-version": "^12.2.0",

View file

@ -2,13 +2,17 @@ import path from 'path'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { babel } from '@rollup/plugin-babel'
import json from '@rollup/plugin-json'
import pkg from './package.json'
const bundledDeps = ['node_modules/dargs', '@commitlint', 'import-meta-resolve', 'global-directory']
export default {
input: 'run.mjs',
external: (depName) =>
depName.includes('node_modules') && !depName.includes('node_modules/dargs'),
output: [{ file: pkg.module, format: 'es' }],
depName.includes('node_modules') &&
bundledDeps.every((bundledDep) => !depName.includes(bundledDep)),
output: [{ file: './dist/run.js', format: 'commonjs' }],
plugins: [
babel({
babelHelpers: 'bundled',
@ -19,5 +23,6 @@ export default {
preferBuiltins: true,
}),
commonjs(),
json(),
],
}