Skip to content

Commit df3d47f

Browse files
authored
Add flag to just close existing comments (#68)
1 parent 0cafab6 commit df3d47f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/bin/pr-metadata-validator.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ struct Args {
2424

2525
#[arg(long)]
2626
give_more_specific_comment_for_earlier_learners: bool,
27+
28+
#[arg(long)]
29+
only_close_existing_comments_with_tag: Option<String>,
2730
}
2831

2932
#[tokio::main]
@@ -45,6 +48,13 @@ async fn main() {
4548
std::env::var("GH_TOKEN").expect("GH_TOKEN wasn't set - must be set to a GitHub API token");
4649
let octocrab = octocrab_for_token(github_token).expect("Failed to get octocrab");
4750

51+
if let Some(tag) = args.only_close_existing_comments_with_tag {
52+
close_existing_comments(&octocrab, &pr, &tag)
53+
.await
54+
.expect("Failed to close existing comments");
55+
exit(0);
56+
}
57+
4858
let course_schedule = make_fake_course_schedule(pr.repo.clone());
4959

5060
let course = CourseScheduleWithRegisterSheetId {

0 commit comments

Comments
 (0)