Skip to content

Commit 8af1b39

Browse files
committed
Fixed pre-release workflow. Updated README for docs. Removed trailing spaces in Webhooks plugin to force a release.
1 parent 6de2286 commit 8af1b39

File tree

5 files changed

+16
-18
lines changed

5 files changed

+16
-18
lines changed

.github/workflows/create-release-branch.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,12 @@ jobs:
4545
- name: Get changed plugin directory
4646
id: plugin
4747
run: |
48-
git fetch --prune --unshallow 2>/dev/null || git fetch --prune
49-
plugin=$(git diff --name-only HEAD~1 HEAD | grep '^plugins/' | head -1 | cut -d/ -f2)
50-
echo "plugin_slug=$plugin" >> $GITHUB_OUTPUT
48+
bash .github/scripts/get-plugin-slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
5149
5250
- name: Validate plugin detection
5351
continue-on-error: false
5452
run: |
55-
if [ ! -d "plugins/${{ steps.plugin.outputs.plugin_slug }}" ]; then
53+
if [ ! -d "plugins/${{ steps.plugin.outputs.slug }}" ]; then
5654
echo "Plugin directory does not exist"
5755
exit 1
5856
fi
@@ -63,7 +61,7 @@ jobs:
6361
- name: Create release branch and apply changesets
6462
run: |
6563
# Create a unique branch name with timestamp
66-
BRANCH_NAME="release/${{ steps.plugin.outputs.plugin_slug }}-$(date +%Y%m%d-%H%M%S)"
64+
BRANCH_NAME="release/${{ steps.plugin.outputs.slug }}-$(date +%Y%m%d-%H%M%S)"
6765
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
6866
6967
# Create and switch to release branch
@@ -81,17 +79,17 @@ jobs:
8179
if git diff --staged --quiet; then
8280
echo "No changes to commit"
8381
else
84-
git commit -m "chore: apply version bump from changesets for ${{ steps.plugin.outputs.plugin_slug }}"
82+
git commit -m "chore: apply version bump from changesets for ${{ steps.plugin.outputs.slug }}"
8583
git push origin "$BRANCH_NAME"
8684
8785
# Create PR
8886
gh pr create \
89-
--title "Release: ${{ steps.plugin.outputs.plugin_slug }} version bump" \
90-
--body "Automated release PR for ${{ steps.plugin.outputs.plugin_slug }} plugin.
87+
--title "Release: ${{ steps.plugin.outputs.slug }} version bump" \
88+
--body "Automated release PR for ${{ steps.plugin.outputs.slug }} plugin.
9189
9290
This PR applies version bumps from changesets. Once merged, it will trigger the pre-release creation workflow.
9391
94-
Plugin: ${{ steps.plugin.outputs.plugin_slug }}" \
92+
Plugin: ${{ steps.plugin.outputs.slug }}" \
9593
--base main \
9694
--head "$BRANCH_NAME"
9795
fi

examples/next/webhooks-isr/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This integration enables seamless communication between a WordPress backend and
2020

2121
## Prerequisites
2222

23-
* WordPress site with the wpgraphql-headless-webhooks plugin installed.
23+
* WordPress site with the wpgraphql-webhooks plugin installed.
2424
* Next.js project (Node.js v18+ recommended).
2525
* Environment variables configured for WordPress URL and webhook secret.
2626

@@ -200,4 +200,4 @@ Congratulations, WordPress should now be fully set up.
200200

201201
If you need database access add the following to your wp-env `"phpmyadminPort": 11111,` (where port 11111 is not allocated).
202202

203-
You can check if a port is free by running `lsof -i :11111`
203+
You can check if a port is free by running `lsof -i :11111`

plugins/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WordPress plugins for the Headless WordPress Toolkit. Each plugin is paired with
77
| Plugin | Description |
88
|--------|-------------|
99
| [`hwp-previews`](./hwp-previews/README.md) | Headless Previews solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. |
10-
| [`wp-graphql-headless-webhooks`](./wp-graphql-headless-webhooks/README.md) | A WordPress plugin that extends [WPGraphQL](https://www.wpgraphql.com/) to support webhook subscriptions and dispatching for headless WordPress environments. This allows external applications to listen and respond to WordPress content changes through GraphQL-driven webhook events. |
10+
| [`wp-graphql-webhooks`](./wp-graphql-webhooks/README.md) | A WordPress plugin that extends [WPGraphQL](https://www.wpgraphql.com/) to support webhook subscriptions and dispatching for headless WordPress environments. This allows external applications to listen and respond to WordPress content changes through GraphQL-driven webhook events. |
1111

1212

1313
## Contributing

plugins/wp-graphql-webhooks/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ License: GPL-3
1010
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1111

1212
== Description ==
13-
== Upgrade Notice ==
13+
== Upgrade Notice ==
1414
== Frequently Asked Questions ==
1515
== Screenshots ==
1616
== Changelog ==

plugins/wp-graphql-webhooks/src/Plugin.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ private function setup(): void {
7979
$this->services->set( 'event_manager', function () {
8080
$repository = $this->services->get( 'repository' );
8181
$handler = $this->services->get( 'handler' );
82-
82+
8383
if ( class_exists( 'WPGraphQL\SmartCache\Document' ) || defined( 'WPGRAPHQL_SMART_CACHE_VERSION' ) ) {
8484
return new SmartCacheWebhookManager( $repository, $handler );
8585
}
86-
86+
8787
return new WebhookEventManager( $repository, $handler );
8888
} );
8989
// Initialize event manager and register hooks
@@ -93,7 +93,7 @@ private function setup(): void {
9393
// Initialize admin UI
9494
if ( is_admin() ) {
9595
$repository = $this->services->get( 'repository' );
96-
96+
9797
if ( class_exists( 'WPGraphQL\Webhooks\Admin\WebhooksAdmin' ) ) {
9898
$admin = new \WPGraphQL\Webhooks\Admin\WebhooksAdmin( $repository );
9999
$admin->init();
@@ -103,7 +103,7 @@ private function setup(): void {
103103
// Initialize REST endpoints
104104
add_action( 'rest_api_init', function () {
105105
$repository = $this->services->get( 'repository' );
106-
106+
107107
if ( class_exists( 'WPGraphQL\Webhooks\Rest\WebhookTestEndpoint' ) ) {
108108
$testEndpoint = new \WPGraphQL\Webhooks\Rest\WebhookTestEndpoint( $repository );
109109
$testEndpoint->register_routes();
@@ -150,4 +150,4 @@ public function __wakeup(): void {
150150
}
151151
}
152152

153-
endif;
153+
endif;

0 commit comments

Comments
 (0)