Closed ted-vo closed 2 years ago
Hey @ted-v9n, thanks for investigating this.
You are right, passed options are converted to the lowercase representation:
https://github.com/go-semantic-release/semantic-release/blob/5c3439156f8ddb84f0e880b6c29f3a719a0b6ed4/pkg/config/config.go#L78
So yes, this is a bug and it is currently impossible to overwrite camelCase configuration options. In your case, you could try the --no-ci
flag to skip the ci condition.
Hi @christophwitzko , thank you so much. I appiled --no-ci to workaround. 👌
awesome, I also fixed it with the next release 🎉
Hi! My repo setting default branch:
develop
I just want to use ci-condition-opt to overridedefaultBranch
. My command:./semantic-release --provider gitlab --ci-condition gitlab --ci-condition-opt defaultBranch="*" --token ***
I see code override ci-condition-opt here: https://github.com/go-semantic-release/semantic-release/blob/5c3439156f8ddb84f0e880b6c29f3a719a0b6ed4/cmd/semantic-release/main.go#L168![image](https://user-images.githubusercontent.com/11543501/157818335-2c97893e-81a0-41c0-9f7b-e30d20d946bb.png)
and pass the conf to condition-gitlab and run condition here: https://github.com/go-semantic-release/condition-gitlab/blob/268fae569178cdfc0b17da5122fa30c7d77f8a03/pkg/condition/gitlab.go#L34![image](https://user-images.githubusercontent.com/11543501/157818306-49716b51-b112-4f1f-b0f9-1aecf8fb1f17.png)
Expected behavior: It should be py pass
defaultBranch
to "*"Actual behavior:
defaultBranch
run atcondition-gitlab.RunCondition
still is value fromrepoInfo.DefaultBranch
Try to debug: I just build
go-semantic-release
by myself to log what it happendedResult is in a picture. Value
defaultBranch="*"
from commend line has been change todefaultbranch:*
(key was lowercase). But actual key isdefaultBranch
pass to RunCondition.Is it a bug?
p/s: Sorry because English is not my primary language.