diff --git a/content_patch_gitlab_api.info.yml b/content_patch_gitlab_api.info.yml
index e3c2d24..7c3d50f 100644
--- a/content_patch_gitlab_api.info.yml
+++ b/content_patch_gitlab_api.info.yml
@@ -3,7 +3,7 @@ description: This module provides content export via the GitLab API.
 package: Content Patch GitLab API
 type: module
 configure: content_patch_gitlab_api.settings
-core_version_requirement: ^10.5 || ^11.2
+core_version_requirement: ^10.5 || ^11.2 || ^12
 dependencies:
   - drupal:serialization
 
diff --git a/content_patch_gitlab_api.module b/content_patch_gitlab_api.module
index d51ce9b..b41b8c4 100644
--- a/content_patch_gitlab_api.module
+++ b/content_patch_gitlab_api.module
@@ -10,35 +10,16 @@ declare(strict_types=1);
  * @file
  * Contains content_patch_gitlab_api.module.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\content_patch_gitlab_api\Hook\ContentPatchGitlabApiHooks;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Url;
 
 /**
  * Implements hook_entity_operation().
  */
-function content_patch_gitlab_api_entity_operation(EntityInterface $entity) {
-  $operations = [];
-
-  // Only show for certain entity types.
-  $allowed_types = ['node', 'media', 'taxonomy_term'];
-  if (!in_array($entity->getEntityTypeId(), $allowed_types)) {
-    return $operations;
-  }
-
-  // Check permission.
-  if (!\Drupal::currentUser()->hasPermission('export content to gitlab api')) {
-    return $operations;
-  }
-
-  $operations['export_gitlab'] = [
-    'title' => t('Export to GitLab'),
-    'weight' => 20,
-    'url' => Url::fromRoute('content_patch_gitlab_api.export', [
-      'entity_type' => $entity->getEntityTypeId(),
-      'entity_id' => $entity->id(),
-    ]),
-  ];
-
-  return $operations;
+#[LegacyHook]
+function content_patch_gitlab_api_entity_operation(EntityInterface $entity)
+{
+    return \Drupal::service(ContentPatchGitlabApiHooks::class)->entityOperation($entity);
 }
diff --git a/content_patch_gitlab_api.services.yml b/content_patch_gitlab_api.services.yml
index fd3198b..ea78acd 100644
--- a/content_patch_gitlab_api.services.yml
+++ b/content_patch_gitlab_api.services.yml
@@ -11,3 +11,7 @@ services:
     class: Drupal\Core\Logger\LoggerChannel
     factory: logger.factory:get
     arguments: ['content_patch_gitlab_api']
+
+  Drupal\content_patch_gitlab_api\Hook\ContentPatchGitlabApiHooks:
+    class: Drupal\content_patch_gitlab_api\Hook\ContentPatchGitlabApiHooks
+    autowire: true
diff --git a/src/Hook/ContentPatchGitlabApiHooks.php b/src/Hook/ContentPatchGitlabApiHooks.php
new file mode 100644
index 0000000..d46171a
--- /dev/null
+++ b/src/Hook/ContentPatchGitlabApiHooks.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\content_patch_gitlab_api\Hook;
+
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Url;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+/**
+ * Hook implementations for content_patch_gitlab_api.
+ */
+class ContentPatchGitlabApiHooks
+{
+    use StringTranslationTrait;
+    /**
+     * Implements hook_entity_operation().
+     */
+    #[Hook('entity_operation')]
+    public function entityOperation(\Drupal\Core\Entity\EntityInterface $entity)
+    {
+        $operations = [
+        ];
+        // Only show for certain entity types.
+        $allowed_types = [
+            'node',
+            'media',
+            'taxonomy_term',
+        ];
+        if (!in_array($entity->getEntityTypeId(), $allowed_types)) {
+            return $operations;
+        }
+        // Check permission.
+        if (!\Drupal::currentUser()->hasPermission('export content to gitlab api')) {
+            return $operations;
+        }
+        $operations['export_gitlab'] = [
+            'title' => $this->t('Export to GitLab'),
+            'weight' => 20,
+            'url' => \Drupal\Core\Url::fromRoute('content_patch_gitlab_api.export', [
+                'entity_type' => $entity->getEntityTypeId(),
+                'entity_id' => $entity->id(),
+            ]),
+        ];
+        return $operations;
+    }
+}
diff --git a/tests/src/Kernel/ContentExportImportTest.php b/tests/src/Kernel/ContentExportImportTest.php
index 8251473..e4df04f 100644
--- a/tests/src/Kernel/ContentExportImportTest.php
+++ b/tests/src/Kernel/ContentExportImportTest.php
@@ -4,6 +4,8 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\content_patch_gitlab_api\Kernel;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
 use Drupal\KernelTests\Core\Entity\EntityKernelTestBase;
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
@@ -16,6 +18,8 @@ use Symfony\Component\Filesystem\Filesystem;
  *
  * @group content_patch_gitlab_api
  */
+#[Group('content_patch_gitlab_api')]
+#[RunTestsInSeparateProcesses]
 class ContentExportImportTest extends EntityKernelTestBase {
 
   /**
