Skip to content
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

fix: git no longer available in container, throws error when using --from-last-tag #4196

Open
4 tasks
jeohist opened this issue Nov 20, 2024 · 0 comments
Open
4 tasks
Labels

Comments

@jeohist
Copy link
Contributor

jeohist commented Nov 20, 2024

Steps to Reproduce

We are using commitlint in our GitLab CI pipelines. With the upgrade to 19.6.0 we noticed unexpected failures, which turns out to be caused by Git no longer being available in the container after #4185.

Config:

commitlint:
  image: commitlint/commitlint:19.5.0
  script:
    npx commitlint --from-last-tag --to "$CI_COMMIT_SHA" --verbose

Current Behavior

Resulting error:

file:///usr/local/lib/node_modules/@commitlint/cli/lib/cli.js:132
        throw err;
        ^
Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:[28](https://gitlab.rnd.mendix.com/devx/ci-templates/-/jobs/5153376#L28)4:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn git',
  path: 'git',
  spawnargs: [
    'describe',
    '--abbrev=40',
    '--always',
    '--first-parent',
    '--long',
    '--tags'
  ]
}
Node.js v18.20.5

Expected Behavior

Commits since last tag should be grabbed and linted.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Install Git in the container, not just in the build layer

Context

No response

commitlint --version

19.6.0

git --version

N/A

node --version

v18.20.5

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

No branches or pull requests

1 participant