mirror of
https://github.com/encounter/ghidra-cli.git
synced 2026-07-10 03:18:56 -07:00
trying to fix github rate limiting
This commit is contained in:
@@ -69,6 +69,8 @@ jobs:
|
||||
cargo run -- setup
|
||||
fi
|
||||
shell: bash
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create test project
|
||||
run: |
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user