I'm currently facing an issue while trying to configure releases in my Gradle project on a protected main branch. I want to prevent direct commits to the main branch and have a user with push access for making releases. However, when attempting to add the --force option to the release configuration, I encounter the following error:
A problem occurred evaluating root project 'app'.
> Cannot cast object '[--force]' with class 'java.util.ArrayList' to class 'org.gradle.api.provider.ListProperty' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.gradle.api.provider.ListProperty(String)
Steps to Reproduce:
Add the following configuration to your Gradle script:
release {
git {
pushOptions = ["--force"]
}
}
Execute the build or release command.
gradle release
Expected behavior:
The release configuration should be applied without any errors, and the --force option should be accepted.
Description:
I'm currently facing an issue while trying to configure releases in my Gradle project on a protected main branch. I want to prevent direct commits to the main branch and have a user with push access for making releases. However, when attempting to add the --force option to the release configuration, I encounter the following error:
Steps to Reproduce:
Expected behavior:
The release configuration should be applied without any errors, and the --force option should be accepted.
Environment:
Thank you for your assistance!