The scanner parameters specific to branches and pull requests, respectively prefixed by sonar.branch. and sonar.pullrequest., can be deduced from environment variables on Cirrus CI.
When analyzing the branch marked as default at GitHub, then the parameter sonar.branch.name must not be set. The env variable CIRRUS_DEFAULT_BRANCH is used to know what is the default branch.
The auto-configuration is enabled if the environment variable CIRRUS_CI is set to true. It is disabled if at least one branch/PR parameter is overridden on command-line.
The Cirrus environment variables are documented at https://cirrus-ci.org/guide/writing-tasks/#environment-variables.
Scanner logs contain:
The auto-configuration mechanism can be disabled by setting the scanner property sonar.branch.autoconfig.disabled to true. It's convenient for example when running integration tests on Cirrus.