Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/get_plugin_slug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HEAD_SHA="$2"
git fetch --prune --unshallow 2>/dev/null || git fetch --prune

# Get changed files in plugins subdirectories
if [ "$BASE_SHA" = "release" ]; then
if [ "$BASE_SHA" = "release" ] || [ "$BASE_SHA" = "main" ]; 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)
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/update_composer_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ usage() {
echo " With custom package name and description:"
echo " $0 '0.0.5' 'https://example.com/plugin.zip' 'wpengine/my-plugin' 'My custom plugin description'"
echo ""
echo "Note: Updates plugins/package.json file"
echo "Note: Updates plugins/composer-packages.json file"
exit 1
}

Expand All @@ -38,7 +38,7 @@ VERSION="$1"
RELEASE_URL="$2"
PACKAGE_NAME="$3"
DESCRIPTION="$4"
COMPOSER_FILE="plugins/package.json"
COMPOSER_FILE="plugins/composer-packages.json"

# Function to extract package name from release URL
extract_package_name() {
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
branches:
- main
paths:
- 'plugins/**.php'
- 'plugins/*/**.php'
pull_request:
paths:
- 'plugins/**.php'
- 'plugins/*/**.php'

jobs:
detect-plugins:
Expand All @@ -31,7 +31,11 @@ jobs:
- name: Get changed plugin directory
id: plugin
run: |
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
if [ "${{ github.event_name }}" = "push" ]; then
bash .github/scripts/get_plugin_slug.sh main
else
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
fi

- name: Detect changed plugins with quality config
id: detect
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
branches:
- main
paths:
- 'plugins/**.php'
- 'plugins/*/**.php'
pull_request:
paths:
- 'plugins/**.php'
- 'plugins/*/**.php'

# Cancel previous workflow run groups that have not completed.
concurrency:
Expand All @@ -38,7 +38,11 @@ jobs:
- name: Get changed plugin directory
id: plugin
run: |
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
if [ "${{ github.event_name }}" = "push" ]; then
bash .github/scripts/get_plugin_slug.sh main
else
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
fi

- name: Detect changed plugins with quality config
id: detect
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
paths:
- "plugins/**"
- "plugins/*/**"

permissions:
contents: write # Allow actions to read and write repository contents
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ on:
branches:
- main
paths:
- 'plugins/**.php'
- 'plugins/**.js'
- 'plugins/**.css'
- 'plugins/**.json'
- 'plugins/*/**.php'
- 'plugins/*/**.js'
- 'plugins/*/**.css'
- 'plugins/*/**.json'
pull_request:
branches:
- main
paths:
- "plugins/**"
- 'plugins/*/**.php'
- 'plugins/*/**.js'
- 'plugins/*/**.css'
- 'plugins/*/**.json'

jobs:
detect-plugin:
Expand All @@ -37,7 +40,11 @@ jobs:
- name: Get changed plugin directory
id: plugin
run: |
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
if [ "${{ github.event_name }}" = "push" ]; then
bash .github/scripts/get_plugin_slug.sh main
else
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
fi

- name: Detect changed plugin with E2E config
id: detect
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/plugin-artifact-for-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Plugin Artifact for PR
on:
pull_request:
paths:
- 'plugins/**.php'
- 'plugins/**.js'
- 'plugins/**.css'
- 'plugins/**.json'
- 'plugins/*/**.php'
- 'plugins/*/**.js'
- 'plugins/*/**.css'
- 'plugins/*/**.json'

jobs:
create-plugin-artifact:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
branches:
- main
paths:
- "plugins/**"
- "plugins/*/*"

permissions:
contents: write
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions plugins/hwp-previews/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
* @link https://github.com/wpengine/hwptoolkit/blob/main/plugins/hwp-previews/TESTING.md
*/

// Ensure proper autoloading
if (file_exists(__DIR__ . '/../../vendor/autoload.php')) {
require_once __DIR__ . '/../../vendor/autoload.php';
}

// Load the main plugin file to ensure all classes are available
if (file_exists(__DIR__ . '/../../hwp-previews.php')) {
require_once __DIR__ . '/../../hwp-previews.php';
}

// Load access functions if they exist
if (file_exists(__DIR__ . '/../../access-functions.php')) {
require_once __DIR__ . '/../../access-functions.php';
}
Loading