我有一个白色源任务在我的Azure DevOps管道。任务看起来像这样:
- task: WhiteSource@21
inputs:
cwd: '$(System.DefaultWorkingDirectory)/sources/'
configuration: |
excludes=**/Examples/**
case.sensitive.glob=false
followSymbolicLinks=true
问题是excludes
参数不工作。
在我的管道日志中,我可以看到以下文本:
##### general #####
... <-- some logs here
#excludes=
... <-- some logs here
可以看到,exclude
在日志中是空的,尽管它在配置中不是空的。在白源报告中,我可以看到一个易受攻击的库XYZ
,它仅由Examples
文件夹内的项目中的代码使用,并且已被排除在外。因此,我得出结论,excludes
参数不起作用。
我很感激你的帮助。
exclude参数需要设置为环境变量。文档中提到:https://docs.mend.io/bundle/unified_agent/page/unified_agent_configuration_parameters.html#Configuration-File-Parameters
然而,经过一些尝试和错误之后,我发现环境变量需要被命名为ws_exclude,以便它被Whitesource Azure DevOps任务正确拾取。
它可以作为一个常规的管道变量添加到管道、阶段或作业中。