You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Trivy action inputs leaking between invocations (#422) (#454)
* fix: use trivy_envs.txt for envs
* test: add test step
* refactor
* refactor
* test
* refactor: use `export` in trivy_envs.txt
* test
* test metadata.json
* test metadata.json
* Clean up envs file better (#422)
- Explicitly rm -f it at start and end of action
- Also remove temporary test steps from action
* Add BATS test for usage of trivy_envs.txt file (#422)
* Add optional step triggered only when Actions Debug logging
Dump the generated environment variables file only when tests are run
with actions debug logging
* Fix to always set env vars into file (#422)
This is done as long as they have a non-empty input value, or a
non-empty default value.
* Clean up env overwriting
- Remove unnecessary debug statements in the action used during testing
- Additional explanatory comments
- Fix to address case where caller explicitly injects environment
variables, either via env: block on the action call or via GITHUB_ENV
* Further refine env var setting logic (#422)
Noted in documenting this fix that what had been implemented deviated
from the existing configuration priority documentation. Amended the
implementation of the Action to try and restore that consistency.
* Fix shell syntax error (#422)
---------
Co-authored-by: DmitriyLewen <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -854,6 +854,13 @@ Following inputs can be used as `step.with` keys:
854
854
### Environment variables
855
855
You can use [Trivy environment variables][trivy-env] to set the necessary options (including flags that are not supported by [Inputs](#inputs), such as `--secret-config`).
856
856
857
+
**NB** In some older versions of the Action there was a bug that caused inputs from one call to the Action to leak
858
+
over to subsequent calls to the Action. This could cause workflows that call the Action multiple times e.g. to run
859
+
multiple scans, or the same scans with different output formats, to not produce the desired output. You can see if this
860
+
is the case by looking at the GitHub Actions step information, if the `env` section shown in your Actions output
861
+
contains `TRIVY_*` environment variables you did not explicitly set then you may be affected by this bug and should
862
+
upgrade to the latest Action version.
863
+
857
864
### Trivy config file
858
865
When using the `trivy-config`[Input](#inputs), you can set options using the [Trivy config file][trivy-config] (including flags that are not supported by [Inputs](#inputs), such as `--secret-config`).
0 commit comments