diff --git a/src/labels.rs b/src/labels.rs index 605d4a1..2715981 100644 --- a/src/labels.rs +++ b/src/labels.rs @@ -10,9 +10,15 @@ use crate::config::GhGptConfig; /// * `cfg` - The application configuration. /// * `issue_number` - The Github issue number. pub async fn labelize(_cfg: &GhGptConfig, org: &str, repo: &str, issue_number: u64) -> Result<()> { - info!("starting task: labelize {}/{} issue #{}", org, repo, issue_number); + info!("👨‍💻 starting task: labelize {}/{} issue #{}", org, repo, issue_number); // Retrieve the issue. let issue = octocrab::instance().issues(org, repo).get(issue_number).await?; info!("issue title: {:?}", issue.title); + + // Update the issue. + // TODO: query the GPT API to retrieve the suggested labels. + octocrab::instance().issues(org, repo).update(issue_number).labels(&["gh-gpt-bot".to_owned()]).send().await?; + + info!("✅ task completed: labelize {}/{} issue #{}", org, repo, issue_number); Ok(()) }