Skip to content

Commit afb761b

Browse files
committed
Ensures that the changes are for plugins not files at root level of plugins.
1 parent f7b37b8 commit afb761b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/pre-release-tag.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches:
1111
- main
1212
paths:
13-
- "plugins/*/*"
13+
- "plugins/*/**"
1414

1515
permissions:
1616
contents: write
@@ -47,14 +47,14 @@ jobs:
4747
- name: Get changed plugin directory
4848
id: plugin
4949
run: |
50-
# Get files changed in the merged PR
51-
plugin=$(git diff --name-only HEAD~1 HEAD | grep '^plugins/' | head -1 | cut -d/ -f2)
52-
if [ -z "$plugin" ]; then
50+
# Get files changed in the merged PR, only match plugins/<plugin>/...
51+
plugin=$(git diff --name-only HEAD~1 HEAD | grep '^plugins/[^/]\+/' | grep -v '^plugins/composer-packages.json' | head -1 | cut -d/ -f2)
52+
if [ -z "$plugin" ]; then
5353
# Fallback: extract from branch name if no plugin changes detected
5454
branch_name="${{ github.head_ref }}"
5555
plugin=$(echo "$branch_name" | sed 's/release\/\([^-]*\)-.*/\1/')
56-
fi
57-
echo "plugin_slug=$plugin" >> $GITHUB_OUTPUT
56+
fi
57+
echo "plugin_slug=$plugin" >> $GITHUB_OUTPUT
5858
5959
- name: Validate plugin detection
6060
run: |

0 commit comments

Comments
 (0)