Skip to content

Commit 6b97796

Browse files
committed
Fixes for workflows when merged into main and there is event pull request sha so the process fails and causes our badges to fail too.
1 parent 066858d commit 6b97796

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/scripts/get_plugin_slug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ HEAD_SHA="$2"
88
git 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)
1313
else
1414
CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep '^plugins/[^/]\+/' || true)

.github/workflows/code-quality.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ jobs:
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

.github/workflows/codeception.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ jobs:
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

.github/workflows/e2e-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ jobs:
3737
- name: Get changed plugin directory
3838
id: plugin
3939
run: |
40-
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
40+
if [ "${{ github.event_name }}" = "push" ]; then
41+
bash .github/scripts/get_plugin_slug.sh main
42+
else
43+
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
44+
fi
4145
4246
- name: Detect changed plugin with E2E config
4347
id: detect

0 commit comments

Comments
 (0)