Skip to content

chore: sync fork with upstream repo #484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
2ff45dc
feat: upgrade commitlint to latest version
wagoid Mar 28, 2024
d901f08
Merge pull request #760 from wagoid/fix/upgrade-commitlint
wagoid Mar 28, 2024
e15adf3
chore(release): publish 5.4.6 [skip-ci]
Mar 28, 2024
06143b2
fix: rollback update of commitlint to support configs that use commonjs
wagoid Mar 28, 2024
234f2a3
ci: include all commits when releasing to build proper release notes
wagoid Mar 28, 2024
b405939
Merge pull request #761 from wagoid/fix/rollback-esm-update
wagoid Mar 28, 2024
adaa347
chore(release): publish 5.5.0 [skip-ci]
Mar 28, 2024
6ee28c9
fix: upgrade commitlint to latest v18
wagoid Mar 28, 2024
05eef5d
Merge pull request #762 from wagoid/fix-upgrade-commitlint-to-latest-v18
wagoid Mar 28, 2024
9763196
chore(release): publish 5.5.1 [skip-ci]
Mar 28, 2024
732f0ad
feat: upgrade to commitlint v19
wagoid Mar 28, 2024
1b31c7b
Merge pull request #763 from wagoid/feat/upgrade-commitlint-v19
wagoid Mar 28, 2024
3c75220
chore(release): publish 6.0.0 [skip-ci]
Mar 28, 2024
edca067
ci: group minor and patch updates in a single PR [skip-ci]
wagoid Apr 1, 2024
70fb930
chore(deps): bump undici from 5.27.0 to 5.28.4
dependabot[bot] Apr 4, 2024
ab651d8
chore(deps-dev): bump the minor-and-patch group with 4 updates
dependabot[bot] Apr 8, 2024
8d57fde
Merge pull request #778 from wagoid/dependabot/npm_and_yarn/undici-5.…
wagoid Apr 10, 2024
8fa8a3e
Merge pull request #779 from wagoid/dependabot/npm_and_yarn/minor-and…
wagoid Apr 10, 2024
bfdc3d1
chore(deps): bump tar from 6.1.11 to 6.2.1
dependabot[bot] Apr 10, 2024
a7438fc
chore(deps): bump ip from 1.1.8 to 1.1.9
dependabot[bot] Apr 10, 2024
7070c25
chore(deps): bump semver
dependabot[bot] Apr 10, 2024
b529831
Merge pull request #781 from wagoid/dependabot/npm_and_yarn/tar-6.2.1
wagoid Apr 10, 2024
d6e1800
Merge pull request #782 from wagoid/dependabot/npm_and_yarn/ip-1.1.9
wagoid Apr 10, 2024
ada5d09
Merge pull request #783 from wagoid/dependabot/npm_and_yarn/multi-362…
wagoid Apr 10, 2024
7f0a61d
chore(release): publish 6.0.1 [skip-ci]
Apr 10, 2024
37ae28d
chore: add catalog-info.yml
celiogafesi May 12, 2022
cd1fd70
chore: add Repofile
Jun 24, 2022
5ce9fe1
chore: setup rebase automation
Jun 24, 2022
5330eae
chore: setup commit signing when rebasing
Jun 27, 2022
e58f3d5
chore: change ownership
celiogafesi Mar 8, 2023
e105409
Merge commit
celiogafesi Jul 24, 2024
89021ff
chore: update Repofile
celiogafesi Dec 5, 2023
9358976
chore(deps): update dependency prettier to v2.8.8 (#395)
tradeshift-renovate[bot] Jan 17, 2024
90c82fb
chore(deps): update babel monorepo to v7.23.7 (#396)
tradeshift-renovate[bot] Jan 17, 2024
e8c2fd9
chore(deps): update dependency commit-and-tag-version to v12.2.0 (#398)
tradeshift-renovate[bot] Jan 17, 2024
41e5c35
chore(deps): update dependency eslint to v8.56.0 (#399)
tradeshift-renovate[bot] Jan 17, 2024
df0ddef
chore(deps): update dependency eslint-config-prettier to v8.10.0 (#400)
tradeshift-renovate[bot] Jan 17, 2024
68fa466
chore(deps): update dependency eslint-plugin-import to v2.29.1 (#401)
tradeshift-renovate[bot] Jan 17, 2024
36ef13d
chore(deps): update dependency lint-staged to v13.3.0 (#402)
tradeshift-renovate[bot] Jan 18, 2024
1b0cfc3
chore(deps): update dependency testdouble to v3.20.1 (#403)
tradeshift-renovate[bot] Jan 18, 2024
17a9d4d
chore(deps): update jest monorepo to v29.7.0 (#404)
tradeshift-renovate[bot] Jan 18, 2024
980eb5b
chore(deps): update actions/cache action to v4 (#406)
tradeshift-renovate[bot] Jan 18, 2024
30bb654
Merge commit
celiogafesi Jul 24, 2024
0df9906
chore(deps): update actions/setup-node action to v4 (#408)
tradeshift-renovate[bot] Jan 18, 2024
71f9d4b
Merge commit
celiogafesi Jul 24, 2024
1e59166
chore(deps): update dependency @rollup/plugin-commonjs to v25 (#410)
tradeshift-renovate[bot] Jan 18, 2024
28ce09f
chore(deps): update dependency @rollup/plugin-node-resolve to v15 (#411)
tradeshift-renovate[bot] Jan 18, 2024
93ce059
chore(deps): update dependency eslint-config-prettier to v9 (#412)
tradeshift-renovate[bot] Jan 18, 2024
11982ea
chore(deps): update dependency lint-staged to v15 (#414)
tradeshift-renovate[bot] Jan 18, 2024
189f63a
chore(deps): update dependency prettier to v3 (#416)
tradeshift-renovate[bot] Jan 18, 2024
f1c3fbb
chore(deps): update dependency eslint-plugin-prettier to v5 (#413)
tradeshift-renovate[bot] Jan 18, 2024
41183f0
chore(deps): update dependency husky to v9 (#421)
tradeshift-renovate[bot] Jan 25, 2024
4299190
chore(deps): update babel monorepo to v7.23.9 (#422)
tradeshift-renovate[bot] Jan 26, 2024
85e31ee
chore(deps): update dependency husky to v9.0.6 (#423)
tradeshift-renovate[bot] Jan 26, 2024
58ab8b1
chore(deps): update dependency husky to v9.0.7 (#424)
tradeshift-renovate[bot] Jan 30, 2024
545b39a
chore(deps): update dependency lint-staged to v15.2.1 (#425)
tradeshift-renovate[bot] Jan 31, 2024
64657a8
chore(deps): update dependency husky to v9.0.10 (#426)
tradeshift-renovate[bot] Feb 1, 2024
2517cc9
chore(deps): update dependency prettier to v3.2.5 (#428)
tradeshift-renovate[bot] Feb 6, 2024
7584f6f
chore(deps): update dependency lint-staged to v15.2.2 (#427)
tradeshift-renovate[bot] Feb 8, 2024
c1bb958
Merge commit
celiogafesi Jul 24, 2024
40d57e7
chore(deps): update dependency husky to v9.0.11
tradeshift-renovate[bot] Feb 14, 2024
aecca6e
chore(deps): update dependency eslint to v8.57.0
tradeshift-renovate[bot] Feb 23, 2024
4d6ffd8
chore(deps): update babel monorepo to v7.24.0
tradeshift-renovate[bot] Feb 28, 2024
bcbd1b8
chore(deps): update babel monorepo to v7.24.3
tradeshift-renovate[bot] Mar 21, 2024
133bdf5
chore(deps): update dependency testdouble to v3.20.2
tradeshift-renovate[bot] Mar 21, 2024
32fd9a3
chore(deps): update babel monorepo to v7.24.4
tradeshift-renovate[bot] Apr 3, 2024
b9be13e
chore(deps): update dependencies
tradeshift-renovate-bulk[bot] Apr 8, 2024
a0f6b2d
chore(deps): update node.js to ^16.20.2
tradeshift-renovate[bot] Apr 8, 2024
4fbb585
fix(deps): update dependency lerna to ^5.6.2
tradeshift-renovate[bot] Apr 8, 2024
079d8cf
chore(deps): update dependency commit-and-tag-version to ^12.4.0
tradeshift-renovate[bot] Apr 19, 2024
651c001
chore(deps): update dependency commit-and-tag-version to ^12.4.1
tradeshift-renovate[bot] Apr 29, 2024
8e9d1a5
chore(deps): update babel monorepo to ^7.24.5
tradeshift-renovate[bot] Apr 30, 2024
a40e37e
chore(deps): update dependency lint-staged to ^15.2.4
tradeshift-renovate[bot] May 23, 2024
168b60c
chore(deps): update dependency @rollup/plugin-commonjs to ^25.0.8
tradeshift-renovate[bot] May 23, 2024
c032c61
chore(deps): update dependency lint-staged to ^15.2.5
tradeshift-renovate[bot] May 25, 2024
20ada9f
chore(deps): update babel monorepo to ^7.24.6
tradeshift-renovate[bot] May 27, 2024
31ff53c
chore(deps): update dependency prettier to ^3.3.0
tradeshift-renovate[bot] Jun 2, 2024
e9eb69d
chore(deps): update dependency prettier to ^3.3.1
tradeshift-renovate[bot] Jun 6, 2024
23c7ab8
chore(deps): update babel monorepo to ^7.24.7
tradeshift-renovate[bot] Jun 6, 2024
e7c1368
chore(deps): update dependency prettier to ^3.3.2
tradeshift-renovate[bot] Jun 13, 2024
aa6912a
chore(deps): update dependencies
tradeshift-renovate-bulk[bot] Jul 15, 2024
f7dabca
chore(deps): update dependency @babel/core to ^7.24.9
tradeshift-renovate[bot] Jul 15, 2024
dcaf55e
chore: disable renovate
celiogafesi Jul 24, 2024
2bd6065
Merge branch 'master' into bang-test
celiogafesi Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
commitlint.config.js
commitlint.config.mjs
action.yml
.github
CHANGELOG.md
Expand Down
7 changes: 6 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@
"node/no-unpublished-require": "off",
"node/no-unpublished-import": "off",
"node/no-unsupported-features/es-syntax": "off"
}
},
"ignorePatterns": [
".github/tasks/actionYamlUpdater.js",
"rollup.config.js",
"fixtures"
]
}
18 changes: 0 additions & 18 deletions .github/dependabot.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"enabled": false
}
4 changes: 2 additions & 2 deletions .github/tasks/actionYamlUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const yaml = require('yaml')

const versionRegex = /\d+\.\d+\.\d+/

module.exports.readVersion = (contents) =>
exports.readVersion = (contents) =>
yaml.parse(contents).runs.image.match(versionRegex)[0]

module.exports.writeVersion = (contents, version) => {
exports.writeVersion = (contents, version) => {
const actionFile = yaml.parse(contents)
actionFile.runs.image = actionFile.runs.image.replace(versionRegex, version)

Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.js → .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
'*.{ts,tsx,vue,css,less,scss,html,htm,md,markdown}': 'prettier --write',
'*.{json,yml,yaml}': ['prettier --write', () => 'npm run test'],
'*.{js,jsx}': ['eslint --fix', () => 'npm run test'],
Expand Down
579 changes: 395 additions & 184 deletions CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: wagoid/commitlint-github-action@v5
- uses: wagoid/commitlint-github-action@v6
```

Alternatively, you can run on other event types such as `on: [push]`. In that case the action will lint the push event's commit(s) instead of linting commits from a pull request. You can also combine `push` and `pull_request` together in the same workflow.

## Inputs

You can supply these inputs to the `wagoid/commitlint-github-action@v5` step.
You can supply these inputs to the `wagoid/commitlint-github-action@v6` step.

### `configFile`

The path to your commitlint config file.

Default: `commitlint.config.js`
Default: `commitlint.config.mjs`

If the config file doesn't exist, [config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) settings will be loaded as a default fallback.

Details on the configuration file can be found on [the commitlint website](https://commitlint.js.org/#/reference-configuration).

Note: `commitlint.config.js` doesn't work with this action. If you use a JS config file, it's required to be an ES Module (`.mjs` extension)

### `failOnWarnings`

Whether you want to fail on warnings or not.
Expand Down Expand Up @@ -149,7 +151,7 @@ jobs:
- run: npm install
# Run the commitlint action, considering its own dependencies and yours as well 🚀
# `github.workspace` is the path to your repository.
- uses: wagoid/commitlint-github-action@v5
- uses: wagoid/commitlint-github-action@v6
env:
NODE_PATH: ${{ github.workspace }}/node_modules
```
Expand Down
9 changes: 4 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
configFile:
description: Commitlint config file. If the file doesn't exist, config-conventional settings will be
loaded as a fallback.
default: ./commitlint.config.js
default: ./commitlint.config.mjs
required: false
failOnWarnings:
description: Whether you want to fail on warnings or not
Expand All @@ -25,9 +25,8 @@ inputs:
required: false
token:
description: >
Personal access token (PAT) used to interact with the GitHub API. By default, the
automatic token provided by GitHub is used. You can see more info about GitHub's default token
here:
Personal access token (PAT) used to interact with the GitHub API. By default, the automatic
token provided by GitHub is used. You can see more info about GitHub's default token here:
https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
default: ${{ github.token }}
required: false
Expand All @@ -36,7 +35,7 @@ outputs:
description: The error and warning messages for each one of the analyzed commits
runs:
using: docker
image: docker://wagoid/commitlint-github-action:5.4.5
image: docker://wagoid/commitlint-github-action:6.0.1
branding:
icon: check-square
color: blue
4 changes: 2 additions & 2 deletions commitlint.config.js → commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
const { maxLineLength } = require('@commitlint/ensure')
import { maxLineLength } from '@commitlint/ensure'

const bodyMaxLineLength = 100

Expand All @@ -14,7 +14,7 @@ const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => {
]
}

module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-function-rules'],
rules: {
Expand Down
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ set -e
if [ -z "$NODE_PATH" ]; then
export NODE_PATH=/node_modules
else
export NODE_PATH=$NODE_PATH:/node_modules
export NODE_PATH="$NODE_PATH":/node_modules
fi

# Since actions/checkout can be setup with a different user ID, we need to set the workspace as safe inside this action
# Info about the vunlerability: https://github.blog/2022-04-12-git-security-vulnerability-announced/
git config --global --add safe.directory "$GITHUB_WORKSPACE"

node /run.js
export NODE_OPTIONS="$NODE_OPTIONS --experimental-vm-modules"

node /run.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
helpUrl: 'https://example.org',
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
plugins: ['commitlint-plugin-jira-rules'],
extends: ['jira'],
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'signed-off-by': [2, 'always', 'Signed-off-by:'],
Expand Down
8 changes: 5 additions & 3 deletions jest.config.js → jest.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module.exports = {
export default {
// Automatically clear mock calls and instances between every test
// preset: 'rollup-jest',
clearMocks: true,
testEnvironment: '@commitlint/test-environment',
testMatch: [
'**/__tests__/**/*.?(m)[jt]s?(x)',
'**/?(*.)+(spec|test).?(m)[tj]s?(x)',
],
transform: {
'\\.[jt]sx?$': 'babel-jest',
},
transformIgnorePatterns: ['node_modules/(?!dargs)'],
}
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { babel } from '@rollup/plugin-babel'
import pkg from './package.json'

export default {
input: 'run.js',
input: 'run.mjs',
external: (depName) =>
depName.includes('node_modules') && !depName.includes('node_modules/dargs'),
output: [{ file: pkg.main, format: 'cjs' }],
output: [{ file: pkg.module, format: 'es' }],
plugins: [
babel({
babelHelpers: 'bundled',
Expand Down
3 changes: 0 additions & 3 deletions run.js

This file was deleted.

3 changes: 3 additions & 0 deletions run.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import action from './src/action.mjs'

action()
9 changes: 8 additions & 1 deletion src/action.js → src/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { context as eventContext, getOctokit } from '@actions/github'
import lint from '@commitlint/lint'
import { format } from '@commitlint/format'
import load from '@commitlint/load'
import generateOutputs from './generateOutputs'
import generateOutputs from './generateOutputs.mjs'

const pullRequestEvent = 'pull_request'
const pullRequestTargetEvent = 'pull_request_target'
Expand Down Expand Up @@ -102,6 +102,13 @@ const showLintResults = async (eventCommits) => {
if (commitDepth) {
commits = commits?.slice(0, commitDepth)
}

if (configPath?.endsWith('.js')) {
throw new Error(
'.js extension is not allowed for the `configFile`, please use .mjs instead',
)
}

const config = existsSync(configPath)
? await load({}, { file: configPath })
: await load({ extends: ['@commitlint/config-conventional'] })
Expand Down
Loading
Loading