Skip to content

Commit e3df43a

Browse files
committed
.github/update-downstream-repos: Include old nextstrain/ingest
I was unable to get the search/code API to work with the 'OR' syntax so just added a separate query for nextstrain/ingest and concatenated the two arrays. Deduplicated the final array to guard against potential overlap.
1 parent d57390b commit e3df43a

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

.github/workflows/update-downstream-repos.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
# ...
2828
# ]
2929
run: |
30-
matrix=$(gh api -X GET search/code \
30+
shared_matrix=$(gh api -X GET search/code \
3131
-f q='org:nextstrain filename:.gitrepo "remote = https://github.com/nextstrain/shared"' \
3232
| jq -c '
3333
.items
@@ -36,6 +36,28 @@ jobs:
3636
"path": "\(.path | split("/")[0:-1] | join("/"))"
3737
})
3838
')
39+
40+
# I was unable to get the 'OR' syntax to work with the search/code API,
41+
# so making a separate query for the old nextstrain/ingest repo name.
42+
# -Jover, 14 Apr 2026.
43+
ingest_matrix=$(gh api -X GET search/code \
44+
-f q='org:nextstrain filename:.gitrepo "remote = https://github.com/nextstrain/ingest"' \
45+
| jq -c '
46+
.items
47+
| map({
48+
"repo": "\(.repository.full_name)",
49+
"path": "\(.path | split("/")[0:-1] | join("/"))"
50+
})
51+
')
52+
53+
# There should not be any overlap between `shared_matrix` and `ingest_matrix`
54+
# but deduplicating with `unique` just in case.
55+
# -Jover, 14 Apr 2026.
56+
matrix=$(jq \
57+
--argjson matrix1 "$shared_matrix" \
58+
--argjson matrix2 "$ingest_matrix" \
59+
-c '$matrix1 + $matrix2 | sort_by(.repo, .path) | unique')
60+
3961
echo "downstream-matrix=$matrix" | tee -a "$GITHUB_OUTPUT"
4062
update-downstream:
4163
name: update-downstream (${{ matrix.repo }}, ${{ matrix.path }})

0 commit comments

Comments
 (0)