trying to fix github rate limiting

This commit is contained in:
Alexander Kiselev
2026-02-22 08:32:26 -08:00
parent 51fab96633
commit 5d0392c741
3 changed files with 20 additions and 0 deletions
+2
View File
@@ -69,6 +69,8 @@ jobs:
cargo run -- setup
fi
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create test project
run: |
+8
View File
@@ -107,6 +107,8 @@ jobs:
cargo run -- setup
fi
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create test project (skip if cached)
run: |
@@ -179,6 +181,8 @@ jobs:
cargo run -- setup
fi
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run read-only integration tests
run: cargo test --test readonly_tests --verbose -- --nocapture
@@ -249,6 +253,8 @@ jobs:
cargo run -- setup
fi
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run mutation integration tests
run: cargo test --test comment_tests --test symbol_tests --test patch_tests --test type_tests --test script_tests --verbose -- --nocapture
@@ -319,6 +325,8 @@ jobs:
cargo run -- setup
fi
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run infrastructure tests
run: cargo test --test daemon_tests --test reliability_tests --test project_tests --verbose -- --nocapture
+10
View File
@@ -66,8 +66,18 @@ pub fn check_java_requirement() -> Result<()> {
/// Resolve the download URL for a Ghidra release.
/// If version is None, fetches the latest release.
pub async fn resolve_version_url(version: Option<String>) -> Result<(String, String, String)> {
let mut headers = reqwest::header::HeaderMap::new();
// Use GITHUB_TOKEN if available (avoids 60 req/hour unauthenticated rate limit)
if let Ok(token) = std::env::var("GITHUB_TOKEN") {
headers.insert(
reqwest::header::AUTHORIZATION,
format!("Bearer {}", token).parse()?,
);
}
let client = reqwest::Client::builder()
.user_agent("ghidra-cli")
.default_headers(headers)
.build()?;
let release: GithubRelease = if let Some(ver) = version {