Skip to content

Commit 275d555

Browse files
Merge branch 'trial-testing:main' into main
2 parents 97d8468 + c11cff2 commit 275d555

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/checkDataConnector.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: pull_request_target
1+
name: Valid on: pull_request_target
22

33
on:
44
pull_request_target:
@@ -19,9 +19,18 @@ jobs:
1919
id: prepare_json_files
2020
run: |
2121
echo "Collecting changed JSON files..."
22-
BASE="origin/${{ github.event.pull_request.base.ref }}"
22+
BASE="${{ github.event.pull_request.base.sha }}"
2323
HEAD="${{ github.event.pull_request.head.sha }}"
24+
2425
mapfile -t files < <(git diff --name-only "$BASE" "$HEAD" | grep '\.json$')
26+
echo "Changed JSON files: ${files[@]}"
27+
28+
if [ ${#files[@]} -eq 0 ]; then
29+
echo "No JSON files changed in this PR."
30+
echo "JSON_PAYLOAD_PATH=empty" >> $GITHUB_ENV
31+
exit 0
32+
fi
33+
2534
json_array="["
2635
for file in "${files[@]}"; do
2736
if [ -f "$file" ]; then
@@ -39,6 +48,7 @@ jobs:
3948
echo "JSON_PAYLOAD_PATH=files_payload.json" >> $GITHUB_ENV
4049
4150
- name: Send JSON files to API and check response
51+
if: env.JSON_PAYLOAD_PATH != 'empty'
4252
env:
4353
API_URL: https://valid1-e2akhdekg6a7a2ch.canadacentral-01.azurewebsites.net/
4454
run: |

0 commit comments

Comments
 (0)