githubtraining / githubtraining/training-manual

Fix script/create-files: if Day 1 collaborator's name contains a name of Day 1 repo admin -> the attendees files and repos are NOT created

Open
#365 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
340
Forks
375
PR merge metrics
No merged PRs in 30d

Description

Found by @chrisn555-im:
Fixed issue where if another users name is a prefix of the repo owner, no files are created

diff --git a/script/create-files b/script/create-files
index 4a235707..8892318a 100755
--- a/script/create-files
+++ b/script/create-files
@@ -23,7 +23,7 @@ add_collaborators() {
echo -e "\nAdding collaborators..."
for commenter in "${commenters[@]}"; do
# Check if commenter is already a collaborator
- if [[ ${collaborators[*]:?} == *"${commenter}"* ]]; then
+ if [[ " ${collaborators[*]} " =~ " ${commenter} " ]]; then
existing_collaborators+=("$commenter")
else # Add collaborator
curl -s -S -i -u "$TOKEN_OWNER:$TEACHER_PAT”\

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.