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

Allow passing in version parameter from command line #194

Open
Alxandr opened this issue Jun 3, 2017 · 4 comments
Open

Allow passing in version parameter from command line #194

Alxandr opened this issue Jun 3, 2017 · 4 comments
Labels
support Issues that do not require modifications to a project, such as questions, guidance, etc.

Comments

@Alxandr
Copy link

Alxandr commented Jun 3, 2017

I'm using conventional-changelog-cli to release something that's not a node repository (that still requires me to have node installed for other reasons). Currently I have as part of my "release" script that it generates a package.json with the correct version in it, calls conventional-changelog, then just deletes the package.json again. It would be great if parameters from package.json could be specified other ways. At least the version parameter should be able to set using the command line easily IMHO.

@stevemao
Copy link
Member

stevemao commented Jun 4, 2017

I thought about it, and it was an option in the old version. But it doesn't fit the paradigm since version is just a context variable. I could argue things like repository should be able to specified as a flag too. Use config flag, It's a generic solution.

@Xapphire13
Copy link
Contributor

Is there any documentation on the config script format? The linked example is super obscure

@hutson hutson added the support Issues that do not require modifications to a project, such as questions, guidance, etc. label Mar 24, 2019
@hutson
Copy link
Contributor

hutson commented Mar 24, 2019

I came across a similar issue. I needed to generate release notes for the latest git tag (the package had already been released and I was just generating notes for the previous release). Also of note, I don't update the version in package.json, so the version field always says 1.0.0.

What I ended up doing was creating a context file with the version I wanted generate release notes for, and then telling conventional-changelog CLI to generate release notes for the latest two versions (a release count of 1 always generates release notes for commits since the last tag).

Here's the script I used:

echo "{\"version\": \"${CI_COMMIT_TAG}\"}" > /tmp/context.json && $(yarn bin)/conventional-changelog --preset @hutson/config --release-count 2 --context /tmp/context.json

@ghostsquad
Copy link

Documentation on how to use the --context besides the example provided by @hutson would be great too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Issues that do not require modifications to a project, such as questions, guidance, etc.
Development

No branches or pull requests

5 participants