Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
gnalh committed Apr 30, 2024
1 parent cd2e2d5 commit 3e16172
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Upload results using action from ${{ matrix.target }}
env:
TRUNK_API_ADDRESS: https://api.trunk-staging.io
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
run: |
target/${{ matrix.target }}/release/trunk-analytics-cli upload \
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Upload results cli release built from source
if: "!cancelled()"
env:
TRUNK_API_ADDRESS: https://api.trunk-staging.io
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
run: |
cargo run --release -- upload \
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \
Expand Down
2 changes: 1 addition & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub const EXIT_FAILURE: i32 = 1;

pub const CODEOWNERS_LOCATIONS: &[&str] = &[".github/", ".bitbucket/", ".gitlab/", "docs/"];

pub const TRUNK_API_ADDRESS_ENV: &str = "TRUNK_API_ADDRESS";
pub const TRUNK_PUBLIC_API_ADDRESS_ENV: &str = "TRUNK_PUBLIC_API_ADDRESS";
pub const ENVS_TO_GET: &'static [&'static str] = &[
"CI",
"GIT_BRANCH",
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tokio_retry::strategy::ExponentialBackoff;
use tokio_retry::Retry;
use trunk_analytics_cli::bundler::BundlerUtil;
use trunk_analytics_cli::clients::get_quarantine_bulk_test_status;
use trunk_analytics_cli::constants::{EXIT_FAILURE, EXIT_SUCCESS, TRUNK_API_ADDRESS_ENV};
use trunk_analytics_cli::constants::{EXIT_FAILURE, EXIT_SUCCESS, TRUNK_PUBLIC_API_ADDRESS_ENV};
use trunk_analytics_cli::runner::run_test_command;
use trunk_analytics_cli::scanner::{BundleRepo, EnvScanner, FileSet, FileSetCounter};
use trunk_analytics_cli::types::{BundleMeta, QuarantineBulkTestStatus, RunResult, META_VERSION};
Expand Down Expand Up @@ -137,7 +137,7 @@ async fn run_upload(upload_args: UploadArgs, test_command: Option<String>) -> an
}

let api_address = from_non_empty_or_default(
std::env::var(TRUNK_API_ADDRESS_ENV).ok(),
std::env::var(TRUNK_PUBLIC_API_ADDRESS_ENV).ok(),
DEFAULT_ORIGIN.to_string(),
|s| s,
);
Expand Down Expand Up @@ -296,7 +296,7 @@ async fn run_test(test_args: TestArgs) -> anyhow::Result<i32> {
}

let api_address = from_non_empty_or_default(
std::env::var(TRUNK_API_ADDRESS_ENV).ok(),
std::env::var(TRUNK_PUBLIC_API_ADDRESS_ENV).ok(),
DEFAULT_ORIGIN.to_string(),
|s| s,
);
Expand Down

0 comments on commit 3e16172

Please sign in to comment.