Skip to content

Commit ae68f51

Browse files
authored
Fixing gh workflow (#1460)
* Fixing gh workflow * Fixing GH actions
1 parent d652a8b commit ae68f51

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/exporter-validate-pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
head_file=$(git show ${{ github.head_ref }}:$file)
3535
3636
# Compare the JSON keys
37-
base_keys=$(echo "$base_file" | jq -r 'paths | map(tostring) | join(".")')
38-
head_keys=$(echo "$head_file" | jq -r 'paths | map(tostring) | join(".")')
37+
base_keys=$(echo "$base_file" | jq -r 'paths | map(tostring) | join(".")' | sed 's/\./\\./g')
38+
head_keys=$(echo "$head_file" | jq -r 'paths | map(tostring) | join(".")' | sed 's/\./\\./g')
3939
4040
# Check for removed keys
4141
removed_keys=$(comm -23 <(echo "$base_keys" | sort) <(echo "$head_keys" | sort))
@@ -45,11 +45,11 @@ jobs:
4545
echo "$removed_keys"
4646
exit 1
4747
fi
48-
48+
4949
# Check for changed values
5050
for key in $base_keys; do
51-
base_value=$(echo "$base_file" | jq -r ".$key")
52-
head_value=$(echo "$head_file" | jq -r ".$key")
51+
base_value=$(echo "$base_file" | jq -r --arg key "$key" '.[$key]')
52+
head_value=$(echo "$head_file" | jq -r --arg key "$key" '.[$key]')
5353
5454
if [ "$base_value" != "$head_value" ]; then
5555
echo "Backward incompatibility change detected in $file. The value of key '$key' was changed from '$base_value' to '$head_value'."
@@ -59,4 +59,4 @@ jobs:
5959
done
6060
6161
echo "All exporter JSON files have only additions. No backward incompatibility changes detected."
62-
shell: bash
62+
shell: bash

0 commit comments

Comments
 (0)