Skip to content

Commit e6fa4f5

Browse files
committed
sync_module_repo_members: Store canonical GitHub username
This commit updates the module repository collaborator/member sync script to save the GitHub usernames in the "canonical" form because Terraform GitHub integration handles the usernames in a case insensitive manner. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent f364fd2 commit e6fa4f5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

terraform/github-zephyrproject-rtos/scripts/sync_module_repo_members.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
set -e
77

8+
get_canonical_username="$(dirname "${BASH_SOURCE[0]}")/get_canonical_username.sh"
9+
810
usage()
911
{
1012
echo "Usage $(basename $0) maintainers_file manifest_path"
@@ -96,19 +98,23 @@ for module_maintainer_entry in "${module_maintainer_entries[@]}"; do
9698

9799
## Write maintainer entries
98100
for maintainer in ${maintainers}; do
99-
if [[ " ${global_admins[@]} " =~ " ${maintainer} " ]]; then
100-
echo "user,${maintainer},admin" >> ${collab_list_file}
101+
username=$(${get_canonical_username} ${maintainer})
102+
103+
if [[ " ${global_admins[@]} " =~ " ${username} " ]]; then
104+
echo "user,${username},admin" >> ${collab_list_file}
101105
else
102-
echo "user,${maintainer},maintain" >> ${collab_list_file}
106+
echo "user,${username},maintain" >> ${collab_list_file}
103107
fi
104108
done
105109

106110
## Write collaborator entries
107111
for collaborator in ${collaborators}; do
108-
if [[ " ${global_admins[@]} " =~ " ${collaborator} " ]]; then
109-
echo "user,${collaborator},admin" >> ${collab_list_file}
112+
username=$(${get_canonical_username} ${collaborator})
113+
114+
if [[ " ${global_admins[@]} " =~ " ${username} " ]]; then
115+
echo "user,${username},admin" >> ${collab_list_file}
110116
else
111-
echo "user,${collaborator},push" >> ${collab_list_file}
117+
echo "user,${username},push" >> ${collab_list_file}
112118
fi
113119
done
114120
done

0 commit comments

Comments
 (0)