mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
Authenticate requests to /release page with GITHUB_TOKEN in CI
This commit is contained in:
1
.github/workflows/test-sys.yaml
vendored
1
.github/workflows/test-sys.yaml
vendored
@@ -214,6 +214,7 @@ jobs:
|
||||
TARGET_DIR: target/${{ matrix.target }}/release
|
||||
CARGO_TARGET: --target ${{ matrix.target }}
|
||||
WAPM_DEV_TOKEN: ${{ secrets.WAPM_DEV_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
#- name: Test integration CLI
|
||||
# if: matrix.run_test && matrix.os == 'windows-2019'
|
||||
|
||||
@@ -1370,8 +1370,16 @@ mod http_fetch {
|
||||
let mut writer = Vec::new();
|
||||
let uri = Uri::try_from("https://api.github.com/repos/wasmerio/wasmer/releases").unwrap();
|
||||
|
||||
let response = Request::new(&uri)
|
||||
.header("User-Agent", "wasmer")
|
||||
// Increases rate-limiting in GitHub CI
|
||||
let auth = std::env::var("GITHUB_TOKEN");
|
||||
let mut response = Request::new(&uri);
|
||||
|
||||
if let Ok(token) = auth {
|
||||
response.header("Authorization", &format!("Bearer {token}"));
|
||||
}
|
||||
|
||||
let response = response
|
||||
.header("User-Agent", "wasmerio")
|
||||
.header("Accept", "application/vnd.github.v3+json")
|
||||
.timeout(Some(std::time::Duration::new(30, 0)))
|
||||
.send(&mut writer)
|
||||
|
||||
Reference in New Issue
Block a user