Skip to content

Commit 97ba4e8

Browse files
committed
fix(ci): validation issue
1 parent 9882478 commit 97ba4e8

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/validate_modified_targets.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- name: Checkout repository
1515
uses: actions/checkout@v5
1616
with:
17+
ref: ${{ github.event.pull_request.head.sha }}
1718
fetch-depth: 0
1819

1920
- name: Set up Python
@@ -38,13 +39,21 @@ jobs:
3839
3940
# Discover changes
4041
git show origin/${{ github.base_ref }}:sherlock_project/resources/data.json > data.json.base
42+
cp sherlock_project/resources/data.json data.json.head
43+
4144
CHANGED=$(
42-
jq -r --slurpfile base data.json.base --slurpfile head sherlock_project/resources/data.json '
43-
[
44-
($head[0] | keys_unsorted[]) as $key
45-
| select(($base[0][$key] != $head[0][$key]) or ($base[0][$key] | not))
46-
| $key
47-
] | unique | join(",")'
45+
python - <<'EOF'
46+
import json
47+
with open("data.json.base") as f: base = json.load(f)
48+
with open("data.json.head") as f: head = json.load(f)
49+
50+
changed = []
51+
for k, v in head.items():
52+
if k not in base or base[k] != v:
53+
changed.append(k)
54+
55+
print(",".join(sorted(changed)))
56+
EOF
4857
)
4958
5059
# Preserve changelist

0 commit comments

Comments
 (0)