Skip to content

Commit 5dc17d6

Browse files
committed
Fixing issue for new plugins that do not exist when creating a plugin artifact.
1 parent 915c25e commit 5dc17d6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/scripts/get_plugin_slug.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ UNIQUE_PLUGINS=($(printf '%s\n' "${PLUGINS[@]}" | sort -u))
3232
# Find the first plugin that actually exists
3333
PLUGIN_SLUG=""
3434
for plugin in "${UNIQUE_PLUGINS[@]}"; do
35-
if [ -d "plugins/$plugin" ]; then
35+
if [ -d "plugins/$plugin" ] || [[ " ${CHANGED_FILES[@]} " =~ "plugins/$plugin/" ]]; then
3636
PLUGIN_SLUG="$plugin"
37-
echo "Found existing plugin directory: $PLUGIN_SLUG"
37+
echo "Found plugin in changes or directory: $PLUGIN_SLUG"
3838
break
3939
fi
4040
done
@@ -45,3 +45,6 @@ if [ -z "$PLUGIN_SLUG" ]; then
4545
fi
4646

4747
echo "slug=$PLUGIN_SLUG" >> "$GITHUB_OUTPUT"
48+
49+
echo "Changed files: $CHANGED_FILES"
50+
echo "Detected plugin(s): ${UNIQUE_PLUGINS[*]}"

.github/workflows/plugin-artifact-for-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.pull_request.head.sha }}
21+
fetch-depth: 0
1922

2023
- name: Get changed plugin directory
2124
id: plugin

0 commit comments

Comments
 (0)