Skip to content

Commit c5f2b8a

Browse files
fix: decode file content with octocrab builtin
1 parent d9ea15a commit c5f2b8a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/github/api/client.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use anyhow::Context;
22
use axum::async_trait;
3-
use base64::Engine;
43
use octocrab::models::{App, Repository, RunId};
54
use octocrab::{Error, Octocrab};
65
use tracing::log;
@@ -66,15 +65,12 @@ impl RepositoryClient for GithubRepositoryClient {
6665
)
6766
})?;
6867

69-
let engine = base64::engine::general_purpose::STANDARD;
7068
response
7169
.take_items()
7270
.into_iter()
7371
.next()
74-
.and_then(|content| content.content)
72+
.and_then(|content| content.decoded_content())
7573
.ok_or_else(|| anyhow::anyhow!("Configuration file not found"))
76-
.and_then(|content| Ok(engine.decode(content.trim())?))
77-
.and_then(|content| Ok(String::from_utf8(content)?))
7874
.and_then(|content| {
7975
let config: RepositoryConfig = toml::from_str(&content).map_err(|error| {
8076
anyhow::anyhow!("Could not deserialize repository config: {error:?}")

0 commit comments

Comments
 (0)