Add an entity reference select to a form I am writing a Drupal 8 module, and I have some code that adds an entity reference field to a form.
$form['commitment']['goal'] = array(
    '#type' =&gt; 'entity_autocomplete',
    '#title' =&gt; 'Goal',
    '#target_type' =&gt; 'node',
    '#selection_settings' =&gt; ['target_bundles' =&gt; ['goal']],
);

This works, except that I want a select list instead of an autocomplete.
How can I accomplish this?
Basing on the OP solution, I would suggest the follow code.

$options = [];
$goal_nodes = \Drupal::entityTypeManager()-&gt;getStorage('node')-&gt;loadByProperties([
  'type' =&gt; 'goal',
]);

foreach ($goal_nodes as $goal_node) {
  $options[$goal_node-&gt;id()] = $goal_node-&gt;label();
}

$form['commitment']['goal'] = [
  '#type' =&gt; 'select',
  '#title' =&gt; t('Goal'),
  '#options' =&gt; $options,
];

This has still two issues:

Entities are not translated
Bundle label ('Goal') is not  programmatically coming