-
-
Notifications
You must be signed in to change notification settings - Fork 1
fix: skip Black Duck CI when credentials not configured #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,8 @@ jobs: | |||||||||||||||||
| - name: Checkout source | ||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||
| - name: Black Duck SCA scan | ||||||||||||||||||
| # Only run if at least one scanning tool is configured | ||||||||||||||||||
| if: vars.BLACKDUCKSCA_URL != '' || vars.COVERITY_URL != '' || vars.POLARIS_SERVER_URL != '' || vars.SRM_URL != '' | ||||||||||||||||||
|
||||||||||||||||||
| # Only run if at least one scanning tool is configured | |
| if: vars.BLACKDUCKSCA_URL != '' || vars.COVERITY_URL != '' || vars.POLARIS_SERVER_URL != '' || vars.SRM_URL != '' | |
| # Only run if at least one scanning tool is configured with both URL and required credentials | |
| if: > | |
| (vars.BLACKDUCKSCA_URL != '' && secrets.BLACKDUCKSCA_TOKEN != '') || | |
| (vars.COVERITY_URL != '' && secrets.COVERITY_USER != '' && secrets.COVERITY_PASSPHRASE != '') || | |
| (vars.POLARIS_SERVER_URL != '' && secrets.POLARIS_ACCESS_TOKEN != '') || | |
| (vars.SRM_URL != '' && secrets.SRM_API_KEY != '') |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard scan on credentials, not just URL vars
The new step condition only checks URL vars (line 35), but the action also requires tokens/passwords from secrets.*. If a URL is configured but the corresponding secret is missing (the exact failure you’re trying to avoid), the step still runs and fails. This means the change doesn’t actually skip when credentials aren’t configured. Consider including the required secrets in the condition (per tool) so missing credentials truly bypass the scan.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude Enleve BlackDUCK de tous mes scan, je n'ai pas les credentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repo’s workflows consistently wrap
ifexpressions using the${{ ... }}syntax (e.g..github/workflows/dependabot-secure-flow.yaml:37). For consistency and to avoid YAML treating the value as a plain string in some contexts, wrap this step condition in${{ }}as well.