I’m running drone v0.8 and I have an issue when DRONE_COMMIT_MESSAGE contains a “#”.
Let’s say the variable contains: Merged in release/1.0.8 (pull request #6).
I’m trying to run a command:
pipeline:
set-build-version:
when:
branch: master
image: alpine
commands:
- echo "${DRONE_COMMIT_MESSAGE}" | grep -o -E 'release/.{0,5}|hotfix/.{0,5}'
Having the hashtag in message causes this output:
echo "Merged in release/1.0.8 (pull request
I tried to do a substitution to remove the “#” using:
- ${DRONE_COMMIT_MESSAGE/#/}
- ${DRONE_COMMIT_MESSAGE/\#/}
- ${DRONE_COMMIT_MESSAGE/’#’/}
I still get the same output regardless.
I know that a # with a space in front in yaml will cause a line stop, but I assumed the variable substitution took place before the yaml parsing.