Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamically determine issue number #419

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions script/create-files
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,18 @@ make_repo_private() {
}

get_commenters() {
# Array of commenters
get_issues # Get a list of issues in the repository

# find issue where participants should be commenting
for issue in "${issues[@]}"; do
if [[ $issue == *"Add collaborators to this repo"* ]]; then
caption_issue_number=$(echo "$issue" | cut -d. -f1)
fi
done

# Array of commenters from the issue
IFS=" " read -ra commenters <<<"$(
curl -s -S -u "$TOKEN_OWNER:$TEACHER_PAT" -X GET "$repo_endpoint/issues/1/comments?per_page=100" |
curl -s -S -u "$TOKEN_OWNER:$TEACHER_PAT" -X GET "$repo_endpoint/issues/$caption_issue_number/comments?per_page=100" |
jq -r 'map(.user.login) | unique | @sh' | tr -d \'
)" >>log.out 2>&1
}
Expand Down
Loading