How to create my own custom simple action in D8? I'm creating a view that is used to review migrated content that was flagged for review during the migration process. I want to provide a bulk action on this view that allows the user to select a bunch and mark them as "resolved".

I created a custom action to do this following some guidance from https://www.drupal.org/node/2330631:

config/install/pu_news_migrate.action.resolve_news_migration_flag.yml

langcode: en
status: true
dependencies:
  module:
    - node
id: resolve_news_migration_flag
label: 'Resolve news migration flag'
type: node
plugin: resolve_news_migration_flag
configuration: {  }


And created the action plugin implementation:

`src/Plugin/Action/ResolveNewsMigrationFlag.php

&lt;?php

namespace Drupal\pu_news_migrate\Plugin\Action;

use Drupal\Core\Action\ActionBase;
use Drupal\Core\Session\AccountInterface;

/**
 * Removes the "needs review" flag on a migrated news article.
 *
 * @Action(
 *   id = "resolve_news_migration_flag",
 *   label = @Translation("Resolve news migration flag"),
 *   type = "node"
 * )
 */
class ResolveNewsMigrationFlag extends ActionBase {

  /**
   * {@inheritdoc}
   */
  public function execute($node = NULL) {
    if ($node) {
      /** @var \Drupal\node\NodeInterface $node */
      if (!$node-&gt;hasField('field_news_migration_review')) {
        throw new \RuntimeException("News migration field not found on node.");
      }
      $node-&gt;set('field_news_migration_review', FALSE);
      $node-&gt;save();
    }
  }

  /**
   * {@inheritdoc}
   */
  public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
    /** @var \Drupal\node\NodeInterface $object */
    $result = $object-&gt;field_news_migration_review-&gt;access('edit', $account, TRUE)
      -&gt;andIf($object-&gt;access('update', $account, TRUE));

    return $return_as_object ? $result : $result-&gt;isAllowed();
  }

}


I also added a schema file: config/schema/pu_news_migrate.schema.yml:

action.configuration.resolve_news_migration_flag:
  type: resolve_news_migration_flag
  label: 'Remove the "needs review" flag from a migrated article.'


I uninstalled the module and re-installed it so that the action definition is loaded into Drupal's config.

However, when I view the list of actions I can select in views, it doesn't appear there. I enabled the "Actions" module which displays a list of all actions, and it does not appear there either.

What did I do wrong here?
Action plugin yaml definitions need to be prefixed with the name system.action.action_name.yml, and not mymodule.action_name.yml.

For reference, check the provided action plugins for node and user module in core in their config/install and config/schema folders.

Uninstall the module, rename the files, and install the module again so the changes are picked up. You should then see your custom action.

So:

config/install/system.action.resolve_news_migration_flag.yml