Skip to content

Dependabot doesn't use the chore type on my repositories; it uses build #439

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

Closed
philippeboyd opened this issue Jun 7, 2022 · 6 comments
Closed

Comments

@philippeboyd
Copy link

I was trying to figure out why commitlint-github-action was giving me errors for body-max-line-length

image

Turns out we're just checking for the chore type in commitlint.config.js

const isDepsCommit = type === 'chore' && (scope === 'deps' || scope === 'deps-dev')

My dependabot is giving me build type instead of chore with default configs

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/frontend"
    schedule:
      interval: "monthly"

image

@jdbruijn
Copy link
Collaborator

jdbruijn commented Jun 9, 2022

That is really something that you should just change in your repositories' commitlint configuration, and make sure this uses your configuration file.

@jdbruijn jdbruijn closed this as completed Jun 9, 2022
@philippeboyd
Copy link
Author

@jdbruijn why did you close this issue, did you take a look at my PR?

From my understanding, Dependabot creates a default commit with a build type unless a previous commit with perhaps an old type was created; see implementation of build_commit_prefix_from_previous_commits.

What I'm saying is that the current default commitlint configs are outdated, hence my PR #440

@jdbruijn
Copy link
Collaborator

I did see the PR indeed. I didn't mean to come off as rude or anything. My point is that this is essentially not an issue with this action, but rather with the used commitlint configuration. In other case dependabot might use Upgrade: or ⬆️ , depending on recent commits.

I'm pretty sure, but @wagoid could confirm if it's indeed correct, we don't even use the configuration file from this repository for anything other then the commits in this repository

const config = existsSync(configPath)
? await load({}, { file: configPath })
: await load({ extends: ['@commitlint/config-conventional'] })
as we'll literally just extend @commitlint/config-conventional as fallback. The fallback being the case where there is no local configuration file, so in your repository for example. To fix this issue you should really create these rules in your local commitlint configuration file(s) and make sure it is called commitlint.config.js or you configure it by means of the configFile option. Hope this helped clarify.

@philippeboyd
Copy link
Author

@jdbruijn Thanks for the explanation! It was my too quick wrong understanding that the file commitlint.config.js in this repo was also considered the default for the Github Action.

However, if I may suggest, what about having an additional config flag in the commitlint action such as ignoreDependabot: true if there's a way to get who created the commits

name: Lint Commit Messages

on:
  - pull_request

jobs:
  commitlint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: wagoid/commitlint-github-action@v4
        with:
          ignoreDependabot: true

That way the github action could be compatible with dependabot without having the need for a custom commitlint.config.js file in the repo.

@jdbruijn
Copy link
Collaborator

jdbruijn commented Jun 14, 2022

AFIK that information is not available. In (#233 (comment)) we also got that question. That information being not available is not decided on by this action, but rather something from commitlint, or I even believe the Git hook, itself. So should be in upstream commitlint (see conventional-changelog/commitlint#2455 and conventional-changelog/commitlint#321 for example). Hope this helps.

@philippeboyd
Copy link
Author

Makes sense, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants