Skip to content

Commit

Permalink
πŸ”Š add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelStark committed May 11, 2023
1 parent 73b7ab5 commit fefb2bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/labels.rs
Expand Up @@ -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(())
}

0 comments on commit fefb2bd

Please sign in to comment.