workflows/eval: Use maintainer GitHub IDs for review requests of changed packages

The handles can change over time and there's nothing guaranteeing the
ones in the maintainer list are up-to-date. In comparison GitHub IDs
never change.
This commit is contained in:
Silvan Mosberger
2024-12-18 22:13:48 +01:00
parent b9d800d468
commit b844cba4e6
2 changed files with 11 additions and 4 deletions
+8 -1
View File
@@ -267,11 +267,18 @@ jobs:
-f "labels[]=$toAdd"
done < <(comm -13 before after)
# maintainers.json contains GitHub IDs. Look up handles to request reviews from.
# There appears to be no API to request reviews based on GitHub IDs
jq -r 'keys[]' comparison/maintainers.json \
| while read -r id; do gh api /user/"$id"; done \
| jq -s '{ reviewers: map(.login) }' \
> reviewers.json
# Request reviewers from maintainers of changed output paths
GH_TOKEN=${{ steps.app-token.outputs.token }} gh api \
--method POST \
/repos/${{ github.repository }}/pulls/${{ github.event.number }}/requested_reviewers \
--input <(jq '{ reviewers: keys }' comparison/maintainers.json)
--input reviewers.json
env:
GH_TOKEN: ${{ github.token }}
+3 -3
View File
@@ -92,7 +92,7 @@ let
builtins.map (
pkg:
builtins.map (maintainer: {
handle = lib.toLower maintainer.github;
id = maintainer.githubId;
packageName = pkg.name;
dueToFiles = pkg.filenames;
}) pkg.maintainers
@@ -103,9 +103,9 @@ let
ping: collector:
collector
// {
"${ping.handle}" = [
"${toString ping.id}" = [
{ inherit (ping) packageName dueToFiles; }
] ++ (collector."${ping.handle}" or [ ]);
] ++ (collector."${toString ping.id}" or [ ]);
}
) { } listToPing;