diff --git a/.changeset/fluffy-apes-begin.md b/.changeset/fluffy-apes-begin.md new file mode 100644 index 00000000..0158744c --- /dev/null +++ b/.changeset/fluffy-apes-begin.md @@ -0,0 +1,5 @@ +--- +"@wpengine/wpgraphql-webhooks-wordpress-plugin": patch +--- + +chore: Initial release of the plugin. diff --git a/.github/scripts/get-plugin-slug.sh b/.github/scripts/get-plugin-slug.sh index 30ced621..8a3591f0 100644 --- a/.github/scripts/get-plugin-slug.sh +++ b/.github/scripts/get-plugin-slug.sh @@ -8,7 +8,11 @@ HEAD_SHA="$2" git fetch --prune --unshallow 2>/dev/null || git fetch --prune # Get changed files in plugins subdirectories -CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep '^plugins/[^/]\+/' || true) +if [ "$BASE_SHA" = "release" ]; then + CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^plugins/[^/]\+/' || true) +else + CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep '^plugins/[^/]\+/' || true) +fi if [ -z "$CHANGED_FILES" ]; then echo "No plugin files changed" diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index a3801a12..4c1a001e 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -45,7 +45,8 @@ jobs: - name: Get changed plugin directory id: plugin run: | - bash .github/scripts/get-plugin-slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }} + bash .github/scripts/get-plugin-slug.sh release + - name: Validate plugin detection continue-on-error: false diff --git a/plugins/wp-graphql-webhooks/src/Type/Webhook.php b/plugins/wp-graphql-webhooks/src/Type/Webhook.php index 16a05c08..f817a51a 100644 --- a/plugins/wp-graphql-webhooks/src/Type/Webhook.php +++ b/plugins/wp-graphql-webhooks/src/Type/Webhook.php @@ -20,52 +20,52 @@ class Webhook { * @return void */ public static function register(): void { - register_graphql_object_type( 'Webhook', [ + register_graphql_object_type( 'Webhook', [ 'description' => __( 'A Webhook configuration object.', 'wp-graphql-webhooks' ), - 'fields' => [ - 'id' => [ + 'fields' => [ + 'id' => [ 'type' => 'ID', 'description' => __( 'The global ID of the webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return (string) $webhook->ID; }, ], - 'eventTrigger' => [ + 'eventTrigger' => [ 'type' => 'String', 'description' => __( 'The event hook name that triggers this webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_post_meta( $webhook->ID, '_event_trigger', true ); }, ], - 'title' => [ + 'title' => [ 'type' => 'String', 'description' => __( 'The title of the webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_the_title( $webhook ); }, ], - 'enabled' => [ + 'enabled' => [ 'type' => 'Boolean', 'description' => __( 'Whether the webhook is enabled.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return (bool) get_post_meta( $webhook->ID, '_enabled', true ); }, ], - 'security' => [ + 'security' => [ 'type' => 'String', 'description' => __( 'Security information for the webhook.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_post_meta( $webhook->ID, '_security', true ); }, ], - 'handlerClass' => [ + 'handlerClass' => [ 'type' => 'String', 'description' => __( 'The handler class used for dispatching.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { return get_post_meta( $webhook->ID, '_handler_class', true ); }, ], - 'handlerConfig' => [ + 'handlerConfig' => [ 'type' => 'String', 'description' => __( 'Configuration for the handler.', 'wp-graphql-webhooks' ), 'resolve' => function ($webhook) { @@ -75,4 +75,4 @@ public static function register(): void { ], ] ); } -} \ No newline at end of file +}