Error when using `magic-zero` with `git-tag`
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 221
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When using both the `magic-zero` and `git-tag` plugin, Auto errors out with `Error: Can't calculate previous version without Git initialized!`.
**To Reproduce**
Configure auto with a plugins field of:
```json
"plugins": [
"magic-zero",
"git-tag"
],
```
and try to run any Auto command.
Output of `yarn auto info --vv`
```
$ /Users/arjunnaha/Developer/__/node_modules/.bin/auto info -vv
ℹ info ENV: {
isCi: false,
commit: '__',
branch: 'master'
}
✔ success Using SEMVER labels:
Map(6) {
'major' => [ 'major' ],
'minor' => [ 'minor' ],
'patch' => [ 'patch', 'performance' ],
'skip' => [ 'skip-release' ],
'release' => [ 'release' ],
'none' => [ 'internal', 'documentation', 'tests', 'dependencies' ]
}
✔ success Loaded `auto` with config: {
plugins: [ 'magic-zero', 'git-tag' ],
owner: '__',
repo: '__',
author: '__',
labels: [
{
name: 'major',
changelogTitle: '💥 Breaking Change',
description: 'Increment the major version when merged',
releaseType: 'major',
color: '#C5000B'
},
{
name: 'minor',
changelogTitle: '🚀 Enhancement',
description: 'Increment the minor version when merged',
releaseType: 'minor',
color: '#F1A60E'
},
{
name: 'patch',
changelogTitle: '🐛 Bug Fix',
description: 'Increment the patch version when merged',
releaseType: 'patch',
color: '#870048'
},
{
name: 'skip-release',
description: 'Preserve the current version when merged',
releaseType: 'skip',
color: '#bf5416'
},
{
name: 'release',
description: 'Create a release when this pr is merged',
releaseType: 'release',
color: '#007f70'
},
{
name: 'internal',
changelogTitle: '🏠 Internal',
description: 'Changes only affect the internal API',
releaseType: 'none',
color: '#696969'
},
{
name: 'documentation',
changelogTitle: '📝 Documentation',
description: 'Changes only affect the documentation',
releaseType: 'none',
color: '#cfd3d7'
},
{
name: 'tests',
changelogTitle: '🧪 Tests',
description: 'Add or improve existing tests',
releaseType: 'none',
color: '#ffd3cc'
},
{
name: 'dependencies',
changelogTitle: '🔩 Dependency Updates',
description: 'Update one or more dependencies version',
releaseType: 'none',
color: '#8732bc'
},
{
name: 'performance',
changelogTitle: '🏎 Performance',
description: 'Improve performance of an existing feature',
releaseType: 'patch',
color: '#f4b2d8'
}
],
prereleaseBranches: [ 'next' ],
versionBranches: undefined
}
ℹ info Found plugin using: /Users/arjunnaha/Developer/__/node_modules/@auto-it/core/dist/plugins/filter-non-pull-request.js
ℹ info Found plugin using: /Users/arjunnaha/Developer/__/node_modules/@auto-it/core/dist/plugins/filter-non-pull-request.js
⚠ warning Could not require module '/snapshot/auto/plugins/magic-zero/dist/index.js'
⚠ warning Could not require module 'auto-plugin-magic-zero'
ℹ info Found plugin using: @auto-it/magic-zero
ℹ info Found plugin using: @auto-it/magic-zero
⚠ warning Could not require module '/snapshot/auto/plugins/git-tag/dist/index.js'
⚠ warning Could not require module 'auto-plugin-git-tag'
ℹ info Found plugin using: @auto-it/git-tag
ℹ info Found plugin using: @auto-it/git-tag
ℹ info Using Filter Non Pull Request Plugin...
ℹ info Using magic-zero Plugin...
ℹ info Using git-tag Plugin...
Error: Can't calculate previous version without Git initialized!
at /Users/arjunnaha/Developer/__/node_modules/@auto-it/git-tag/src/index.ts:29:15
at eval (eval at create (/Users/arjunnaha/Developer/__/node_modules/tapable/lib/HookCodeFactory.js:75:10), :16:17)
at new Promise ()
at Hook.eval [as promise] (eval at create (/Users/arjunnaha/Developer/__/node_modules/tapable/lib/HookCodeFactory.js:75:10), :6:8)
at Hook.PROMISE_DELEGATE [as _promise] (/Users/arjunnaha/Developer/__/node_modules/tapable/lib/Hook.js:22:14)
at /Users/arjunnaha/Developer/__/node_modules/@auto-it/magic-zero/src/index.ts:44:59
at eval (eval at create (/Users/arjunnaha/Developer/__/node_modules/tapable/lib/HookCodeFactory.js:75:10), :16:17)
at new Promise ()
at Hook.eval [as promise] (eval at create (/Users/arjunnaha/Developer/__/node_modules/tapable/lib/HookCodeFactory.js:75:10), :6:8)
at Hook.PROMISE_DELEGATE [as _promise] (/Users/arjunnaha/Developer/__/node_modules/tapable/lib/Hook.js:22:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
```
**Environment information:**
Yarn lockfile
```
auto@^10.24.1:
version "10.24.1"
resolved "https://registry.yarnpkg.com/auto/-/auto-10.24.1.tgz#b41042f10f6e093b7e2167423c66fc881da90c2b"
integrity sha512-vYE3UPZu1NVCRr36OSmgW20N0Df5MU3KBReliETa3NM8Awq3c2N41tH8QG0/uCbdgECVbC8vDqCd47aO2vGQTg==
dependencies:
"@auto-it/core" "10.24.1"
"@auto-it/npm" "10.24.1"
"@auto-it/released" "10.24.1"
await-to-js "^3.0.0"
chalk "^4.0.0"
command-line-application "^0.10.1"
endent "^2.0.1"
module-alias "^2.2.2"
signale "^1.4.0"
terminal-link "^2.1.1"
tslib "2.1.0"
"@auto-it/bot-list@10.24.1":
version "10.24.1"
resolved "https://registry.yarnpkg.com/@auto-it/bot-list/-/bot-list-10.24.1.tgz#224c107c78137da93d1644da7ed05f741cddcfd2"
integrity sha512-SBBJ8lnxqk9lrMP6LhVCrPhApDeTAKyXh2+/IIngaCmmj+LEOrwT547pec7RiZj0TbF/f0cgF3S+JzQrbTySxw==
"@auto-it/core@10.24.1":
version "10.24.1"
resolved "https://registry.yarnpkg.com/@auto-it/core/-/core-10.24.1.tgz#57e05ce0915eed9048ecc8346c9376e93a577db7"
integrity sha512-dSuTPO2ZEUASz1Xs/4TnFMb6SE4ODSLdlAlxJhA9V5aR3p9+ijIrdHxHkd4dZo8/Lmf886I5wTZyZQI/SixWpw==
dependencies:
"@auto-it/bot-list" "10.24.1"
"@endemolshinegroup/cosmiconfig-typescript-loader" "^3.0.2"
"@octokit/plugin-enterprise-compatibility" "^1.2.2"
"@octokit/plugin-retry" "^3.0.1"
"@octokit/plugin-throttling" "^3.2.0"
"@octokit/rest" "^18.0.0"
await-to-js "^3.0.0"
chalk "^4.0.0"
cosmiconfig "7.0.0"
deepmerge "^4.0.0"
dotenv "^8.0.0"
endent "^2.0.1"
enquirer "^2.3.4"
env-ci "^5.0.1"
fast-glob "^3.1.1"
fp-ts "^2.5.3"
fromentries "^1.2.0"
gitlog "^4.0.3"
https-proxy-agent "^5.0.0"
import-cwd "^3.0.0"
import-from "^3.0.0"
io-ts "^2.1.2"
lodash.chunk "^4.2.0"
log-symbols "^4.0.0"
node-fetch "2.6.1"
parse-author "^2.0.0"
parse-github-url "1.0.2"
pretty-ms "^7.0.0"
requireg "^0.2.2"
semver "^7.0.0"
signale "^1.4.0"
tapable "^2.0.0-beta.2"
terminal-link "^2.1.1"
tinycolor2 "^1.4.1"
ts-node "^9.1.1"
tslib "2.1.0"
type-fest "^0.21.1"
typescript-memoize "^1.0.0-alpha.3"
url-join "^4.0.0"
"@auto-it/git-tag@^10.24.1":
version "10.24.1"
resolved "https://registry.yarnpkg.com/@auto-it/git-tag/-/git-tag-10.24.1.tgz#89a1a643c79eed0798cc509715d23cea2605e843"
integrity sha512-gpTHejBZBouvlqk0XxDMYDD6ewgihZ+/go9cYGyigttKVUhkLFzAnE41Fw0AR7eLf88Fuxs+AtZu2KGCSNExWw==
dependencies:
"@auto-it/core" "10.24.1"
semver "^7.0.0"
tslib "2.1.0"
"@auto-it/magic-zero@^10.22.1":
version "10.24.1"
resolved "https://registry.yarnpkg.com/@auto-it/magic-zero/-/magic-zero-10.24.1.tgz#0ed24eb4685acd25126f812427b89ffb14488476"
integrity sha512-dduq2GR8a0AbjdKJrXkAUxcht13YupmpFQ2C+Vq5LFyGLJXqV6nYkVbtsrh3ZpaPfvVFUfShiSWrFimsA/PFKg==
dependencies:
"@auto-it/core" "10.24.1"
fp-ts "^2.5.3"
io-ts "^2.1.2"
semver "^7.0.0"
tslib "2.1.0"
"@auto-it/npm@10.24.1":
version "10.24.1"
resolved "https://registry.yarnpkg.com/@auto-it/npm/-/npm-10.24.1.tgz#4220124901a74e56a442f5001b1d668c44e64422"
integrity sha512-zkOBipEexLcOFDwQKUdYaWFmJg7+yaOPfWgjvqBVgy/Ky4aEUfY/UGEsIUUb2AJgK3ExVq6O8rtwLY4q+cR+3Q==
dependencies:
"@auto-it/core" "10.24.1"
"@auto-it/package-json-utils" "10.24.1"
await-to-js "^3.0.0"
endent "^2.0.1"
env-ci "^5.0.1"
fp-ts "^2.5.3"
get-monorepo-packages "^1.1.0"
io-ts "^2.1.2"
registry-url "^5.1.0"
semver "^7.0.0"
tslib "2.1.0"
typescript-memoize "^1.0.0-alpha.3"
url-join "^4.0.0"
user-home "^2.0.0"
"@auto-it/package-json-utils@10.24.1":
version "10.24.1"
resolved "https://registry.yarnpkg.com/@auto-it/package-json-utils/-/package-json-utils-10.24.1.tgz#f1630ff304441e49752a94ee09b56545bd502d33"
integrity sha512-VW8+kjraAHbPieDLJX/Q138suCKnywf8V5+RrOJT4w3k8rOFyJzTYB4sNYHWNoMLxnv5xZoMsxh5ikJ5FbIEZg==
dependencies:
parse-author "^2.0.0"
parse-github-url "1.0.2"
"@auto-it/released@10.24.1":
version "10.24.1"
resolved "https://registry.yarnpkg.com/@auto-it/released/-/released-10.24.1.tgz#907ff732ba692f6583761ac1542c80e6bf95978f"
integrity sha512-BeN8mKykH1jE9C7sB+ttQ1JMZBxVwl3j9HrGikrKcYBW8pDAQACFVsEIeMfio2QxJVFBu1VovnUEXhl3XqZtQw==
dependencies:
"@auto-it/bot-list" "10.24.1"
"@auto-it/core" "10.24.1"
deepmerge "^4.0.0"
fp-ts "^2.5.3"
io-ts "^2.1.2"
tslib "2.1.0"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.