commitlint-github-action icon indicating copy to clipboard operation
commitlint-github-action copied to clipboard

helpURL input should overrule configuration

Open korthout opened this issue 1 year ago • 2 comments

I used the following in my workflow:

- uses: wagoid/commitlint-github-action@v5
  with:
    commitDepth: ${{ github.event.pull_request.commits }}
    helpURL: http://acme.com/example-url

To my surprise, the workflow logs contained:

Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

This is because my very basic config pulled in the helpUrl from @commitlint/config-conventional.

module.exports = { extends: ['@commitlint/config-conventional'] };

To me, this was unexpected because I explicitly told the action to use http://acme.com/example-url as the helpURL.

I would propose to flip the sides of the || or operator here so the defined inputs are favored over the configuration:

helpUrl: getInput('helpURL') || config.helpUrl,

korthout avatar Mar 29 '23 07:03 korthout

This happens even without an extended config; I don't have a config file at all and the helpURL is still not honored. Full config of my step:

      - uses: actions/wagoid_commitlint-github-action@456526eec71276a59e74aafdfe06a9632ac2eee1 # v5.4.1
        with:
          helpURL: "${{ github.server_url }}/${{ github.repository }}/blob/main/CONTRIBUTING.md"

Here's the output I get (with details redacted)

Run actions/wagoid_commitlint-github-action@456526eec71276a59e74aafdfe06a9632ac2eee1 with: helpURL: https://myGHES/myOrga/myRepo/blob/main/CONTRIBUTING.md configFile: ./commitlint.config.js firstParent: true failOnWarnings: false failOnErrors: true token: *** /usr/bin/docker run --name wagoidcommitlintgithubaction541_242aeb [...] wagoid/commitlint-github-action:5.4.1 Error: You have commit messages with errors

[...]

✖ found 2 problems, 0 warnings ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

So it correctly sets the input, but it has no effect.

SvenStaehs avatar May 31 '23 12:05 SvenStaehs

Would be nice to have this fixed somehow. Seems to be still ongoing also in v5.

Run wagoid/commitlint-github-action@v5
  with:
    helpURL: https://PROPERURL/display/CLOUDVOL/Github+commit+lint

But the error message still says the default one

Error: You have commit messages with errors

⧗   input: refactor(JIRA-80325): remove managed clusters from aks cluster creation.
✖   subject may not end with full stop [subject-full-stop]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

jprecuch avatar Mar 21 '24 16:03 jprecuch