The variable DRONE_COMMIT_MESSAGE has a trailing newline. This is not desirable for commands and can sometimes interfere with parsing.
For example, with a commit message of Test message, the following command line in drone.yml
- if ! echo ${DRONE_COMMIT_MESSAGE} | grep -q ...
…gets expanded as
+ if ! echo "Test message\n" | grep -q ...
If the commit message contains colons, then this example will throw off the yaml parser. Of course, the whole line could be wrapped in quotes, but if it is generated from Starlark with drone starlark, then quotes are not added automatically. It would be best to remove the trailing newline from DRONE_COMMIT_MESSAGE.
The commit message comes from webhooks delivered by your source control management system (e.g. github, gitlab, gitea). If you are seeing a newline appended to your commit message it is likely being added by your source control management system, not by Drone. For example, if you look at a real-world gitea payload [2] you will see that gitea appends a newline to commit message (if this is undesirable, you would need to raise an issue with the gitea team). If you look at a real-world github payload [3] you will see there is no trailing newline.