Skip to content

Commit 8a052e4

Browse files
committed
sync_team_membership: Add maintainers and collaborators to contributors
Add all maintainers and collaborators listed in the Zephyr MAINTAINERS file to the 'contributors' team. This ensures that, when a collaborator is promoted to maintainer (i.e. when a user is removed from the 'collaborators' team and added to the 'maintainers' team) or vice versa, the user is not removed from and re-added to the zephyrproject-rtos organisation. Note that this should be automatically done even without the intervention of this script in the future because the documented process requires that a user be a contributor prior to being promoted to a collaborator or a maintainer. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent a94fb5f commit 8a052e4

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ all_collaborators=$(echo "${all_collaborators}" | sort -f -u)
5353
all_maintainers=$(echo "${maintainers_data}" | yq -r '.[].maintainers.[]')
5454
all_maintainers=$(echo "${all_maintainers}" | sort -f -u)
5555

56-
# Write team member list files
56+
# Read global admin list
5757
global_admins=$(<${manifest_path}/global-admins.csv)
5858
global_admins=$(echo "${global_admins}" | tail -n +2)
5959
global_admins=(${global_admins})
6060

61+
# Write maintainer and collaborator team member list files
62+
collaborators_csv="${manifest_path}/team/team-members/collaborators.csv"
63+
maintainers_csv="${manifest_path}/team/team-members/maintainers.csv"
64+
6165
write_team_member_list()
6266
{
6367
output_file="$1"
@@ -75,5 +79,17 @@ write_team_member_list()
7579
done
7680
}
7781

78-
write_team_member_list "${manifest_path}/team/team-members/collaborators.csv" "${all_collaborators}"
79-
write_team_member_list "${manifest_path}/team/team-members/maintainers.csv" "${all_maintainers}"
82+
write_team_member_list "${collaborators_csv}" "${all_collaborators}"
83+
write_team_member_list "${maintainers_csv}" "${all_maintainers}"
84+
85+
# Add all maintainers and collaborators to the contributors team member list
86+
contributors_csv="${manifest_path}/team/team-members/contributors.csv"
87+
88+
tail -n +2 "${maintainers_csv}" >> "${contributors_csv}"
89+
tail -n +2 "${collaborators_csv}" >> "${contributors_csv}"
90+
91+
contributors_data=$(tail -n +2 "${contributors_csv}")
92+
contributors_data=$(echo "${contributors_data}" | sort -f | uniq -i)
93+
94+
echo "username,role" > "${contributors_csv}"
95+
echo "${contributors_data}" >> "${contributors_csv}"

0 commit comments

Comments
 (0)