Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions actions/commitlint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ https://github.com/conventional-changelog/commitlint

## Simple configuration

1. `echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js`
1. `echo "export default {extends: ['@commitlint/config-conventional']}" > commitlint.config.mjs`
2. `trunk actions enable commitlint`

This will install the basic config and run commitlint on every `commit-msg` hook.
Expand All @@ -14,7 +14,7 @@ This will install the basic config and run commitlint on every `commit-msg` hook
In order to use different commitlint configuration or specify a specific commitlint version, you
must:

1. Modify your `commitlint.config.js` accordingly
1. Modify your `commitlint.config.mjs` accordingly
2. Override the `packages_file` field for the action and specify a package.json

For example:
Expand All @@ -30,10 +30,10 @@ actions:
packages_file: ${workspace}/.trunk/commitlint/package.json
```

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

```js
module.exports = {
export default {
extends: ["@commitlint/config-angular", "@commitlint/config-conventional"],
};
```
Expand Down
4 changes: 2 additions & 2 deletions actions/commitlint/commitlint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { TrunkActionDriver } from "tests/driver";

const preCheck = (driver: TrunkActionDriver) => {
driver.writeFile(
"commitlint.config.js",
"module.exports = {extends: ['@commitlint/config-conventional']}",
"commitlint.config.mjs",
"export default {extends: ['@commitlint/config-conventional']}",
Comment on lines -7 to +8
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how renaming the file and using export default should be handled by trunk when upgrading to this version. I.e. how to handle breaking changers in tools supported by trunk?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose its up to the user to configure the commitlint config file. I’ll need to update the commitlint readme here: https://github.com/trunk-io/plugins/tree/main/actions/commitlint

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @rriski and for bringing this to our attention! I'll speak with the team about if there is any better way we can handle the update process for users. I think we will probably want to go ahead and land this, and also update the readme instructions, as you mentioned, but I'll follow-up again shortly.

);
};

Expand Down
4 changes: 2 additions & 2 deletions actions/commitlint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@commitlint/cli": "^17.0",
"@commitlint/config-conventional": "^17.0"
"@commitlint/cli": "^19.0",
"@commitlint/config-conventional": "^19.0"
}
}