Skip to content

Commit c40f797

Browse files
committed
make generator use github token
1 parent 23b2cb8 commit c40f797

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

generator/src/main.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,20 @@ enum Mode {
9191
},
9292
}
9393

94+
fn init_github() -> Result<()> {
95+
let builder = if let Ok(token) = std::env::var("GITHUB_TOKEN") {
96+
octocrab::OctocrabBuilder::new().personal_token(token)
97+
} else {
98+
octocrab::OctocrabBuilder::new()
99+
};
100+
octocrab::initialise(builder)?;
101+
Ok(())
102+
}
103+
94104
#[async_std::main]
95105
async fn main() -> Result<()> {
96106
color_eyre::install()?;
107+
init_github()?;
97108
match Mode::from_args() {
98109
Mode::Lint { config_file, print } => {
99110
let config = Config::load(&config_file).await?;

0 commit comments

Comments
 (0)