Skip to content

Commit

Permalink
fix: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jenae-janzen committed Nov 15, 2023
1 parent 7895539 commit 5bdda09
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build]
command = 'cp -r ./src/static-files ./dist'
publish = "./dist"

[build.environment]
ENV_VAR_1 = "val1-val1-val1"
ENV_VAR_2 = "val2-val2-val2"
SECRETS_SCAN_OMIT_PATHS = "netlify.toml"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
safe-val
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
not secret val
7 changes: 7 additions & 0 deletions packages/build/tests/secrets_scanning/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,10 @@ test('secrets scanning, should not fail if the secrets values are not detected i
.runWithBuild()
t.true(output.includes(`No secrets detected in build output or repo code!`))
})

test.only('secrets scanning should not scan .cache/ directory', async (t) => {
const output = await new Fixture('./fixtures/src_scanning_omit_cache_path')
.withFlags({ debug: false, explicitSecretKeys: 'ENV_VAR_1,ENV_VAR_2' })
.runWithBuild()
t.true(output.includes(`No secrets detected in build output or repo code!`))
})

0 comments on commit 5bdda09

Please sign in to comment.