From b32e87c70d0875458a79bd99130c21d3f9b29a07 Mon Sep 17 00:00:00 2001 From: Jake Swenson Date: Sat, 15 May 2021 21:45:38 -0700 Subject: fix: Test include_str in CI --- .github/workflows/build.yml | 4 ++++ src/lib.rs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f15e74e..52084ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,10 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features + - name: Security audit + uses: actions-rs/audit-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} build: strategy: matrix: diff --git a/src/lib.rs b/src/lib.rs index 8aeeb62..0dd8366 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -114,8 +114,10 @@ mod tests { let token = { if let Some(token) = std::env::var("NOTION_API_TOKEN").ok() { token + } else if let Some(token) = std::fs::read_to_string(".api_token").ok() { + token } else { - include_str!(".api_token").to_string() + panic!("No API Token found in environment variable 'NOTION_API_TOKEN'!") } }; token.trim().to_string() -- cgit v1.2.3