File tree Expand file tree Collapse file tree 10 files changed +36
-24
lines changed
Expand file tree Collapse file tree 10 files changed +36
-24
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ HEAD_SHA="$2"
88git fetch --prune --unshallow 2> /dev/null || git fetch --prune
99
1010# Get changed files in plugins subdirectories
11- if [ " $BASE_SHA " = " release" ]; then
11+ if [ " $BASE_SHA " = " release" ] || [ " $BASE_SHA " = " main " ] ; then
1212 CHANGED_FILES=$( git diff --name-only HEAD~1 HEAD | grep ' ^plugins/[^/]\+/' || true)
1313else
1414 CHANGED_FILES=$( git diff --name-only " $BASE_SHA " " $HEAD_SHA " | grep ' ^plugins/[^/]\+/' || true)
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ usage() {
2323 echo " With custom package name and description:"
2424 echo " $0 '0.0.5' 'https://example.com/plugin.zip' 'wpengine/my-plugin' 'My custom plugin description'"
2525 echo " "
26- echo " Note: Updates plugins/package .json file"
26+ echo " Note: Updates plugins/composer-packages .json file"
2727 exit 1
2828}
2929
@@ -38,7 +38,7 @@ VERSION="$1"
3838RELEASE_URL=" $2 "
3939PACKAGE_NAME=" $3 "
4040DESCRIPTION=" $4 "
41- COMPOSER_FILE=" plugins/package .json"
41+ COMPOSER_FILE=" plugins/composer-packages .json"
4242
4343# Function to extract package name from release URL
4444extract_package_name () {
Original file line number Diff line number Diff line change 1212 branches :
1313 - main
1414 paths :
15- - ' plugins/**.php'
15+ - ' plugins/*/* *.php'
1616 pull_request :
1717 paths :
18- - ' plugins/**.php'
18+ - ' plugins/*/* *.php'
1919
2020jobs :
2121 detect-plugins :
3131 - name : Get changed plugin directory
3232 id : plugin
3333 run : |
34- bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
34+ if [ "${{ github.event_name }}" = "push" ]; then
35+ bash .github/scripts/get_plugin_slug.sh main
36+ else
37+ bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
38+ fi
3539
3640 - name : Detect changed plugins with quality config
3741 id : detect
Original file line number Diff line number Diff line change 1212 branches :
1313 - main
1414 paths :
15- - ' plugins/**.php'
15+ - ' plugins/*/* *.php'
1616 pull_request :
1717 paths :
18- - ' plugins/**.php'
18+ - ' plugins/*/* *.php'
1919
2020# Cancel previous workflow run groups that have not completed.
2121concurrency :
3838 - name : Get changed plugin directory
3939 id : plugin
4040 run : |
41- bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
41+ if [ "${{ github.event_name }}" = "push" ]; then
42+ bash .github/scripts/get_plugin_slug.sh main
43+ else
44+ bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
45+ fi
4246
4347 - name : Detect changed plugins with quality config
4448 id : detect
Original file line number Diff line number Diff line change 88 branches :
99 - main
1010 paths :
11- - " plugins/**"
11+ - " plugins/*/* *"
1212
1313permissions :
1414 contents : write # Allow actions to read and write repository contents
Original file line number Diff line number Diff line change 1313 branches :
1414 - main
1515 paths :
16- - ' plugins/**.php'
17- - ' plugins/**.js'
18- - ' plugins/**.css'
19- - ' plugins/**.json'
16+ - ' plugins/*/* *.php'
17+ - ' plugins/*/* *.js'
18+ - ' plugins/*/* *.css'
19+ - ' plugins/*/* *.json'
2020 pull_request :
2121 branches :
2222 - main
2323 paths :
24- - " plugins/**"
24+ - ' plugins/*/**.php'
25+ - ' plugins/*/**.js'
26+ - ' plugins/*/**.css'
27+ - ' plugins/*/**.json'
2528
2629jobs :
2730 detect-plugin :
3740 - name : Get changed plugin directory
3841 id : plugin
3942 run : |
40- bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
43+ if [ "${{ github.event_name }}" = "push" ]; then
44+ bash .github/scripts/get_plugin_slug.sh main
45+ else
46+ bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
47+ fi
4148
4249 - name : Detect changed plugin with E2E config
4350 id : detect
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ name: Plugin Artifact for PR
33on :
44 pull_request :
55 paths :
6- - ' plugins/**.php'
7- - ' plugins/**.js'
8- - ' plugins/**.css'
9- - ' plugins/**.json'
6+ - ' plugins/*/* *.php'
7+ - ' plugins/*/* *.js'
8+ - ' plugins/*/* *.css'
9+ - ' plugins/*/* *.json'
1010
1111jobs :
1212 create-plugin-artifact :
Original file line number Diff line number Diff line change 1010 branches :
1111 - main
1212 paths :
13- - " plugins/**"
13+ - " plugins/*/ *"
1414
1515permissions :
1616 contents : write
File renamed without changes.
Original file line number Diff line number Diff line change 77 * @link https://github.com/wpengine/hwptoolkit/blob/main/plugins/hwp-previews/TESTING.md
88 */
99
10- // Ensure proper autoloading
1110if (file_exists (__DIR__ . '/../../vendor/autoload.php ' )) {
1211 require_once __DIR__ . '/../../vendor/autoload.php ' ;
1312}
1413
15- // Load the main plugin file to ensure all classes are available
1614if (file_exists (__DIR__ . '/../../hwp-previews.php ' )) {
1715 require_once __DIR__ . '/../../hwp-previews.php ' ;
1816}
1917
20- // Load access functions if they exist
2118if (file_exists (__DIR__ . '/../../access-functions.php ' )) {
2219 require_once __DIR__ . '/../../access-functions.php ' ;
2320}
You can’t perform that action at this time.
0 commit comments