In order to prevent the step from failing after receiving a non-zero return code, I used code = $? To receive the error code so that this command that might fail returns 0, but it seems that this still does not solve the problem of step failure .
steps: - name: lint image: alpine/git commands: - change=$(git show $DRONE_COMMIT ./CHANGELOG.md 2> /dev/null); code=$? - if [ ! $code -eq 0 ]; then echo 'CHANGELOG.md not fount.'; exit $code; fi - if [ -z $change ]; then echo 'CHANGELOG.md no change.'; exit 1; fi