@ibm-cloud/cd-tools 1.15.22 → 1.15.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -218,16 +218,16 @@ async function validateTools(token, tcId, region, skipPrompt) {
218
218
  if (tool.tool_type_id === 'pipeline' && tool.parameters?.type === 'tekton') { // Check for secrets in Tekton pipeline
219
219
  const pipelineData = await getPipelineData(token, tool.id, region);
220
220
 
221
- pipelineData.properties.forEach((prop) => {
222
- if (prop.type === 'secure' && !isSecretReference(prop.value) && prop.value.length > 0)
221
+ pipelineData.properties?.forEach((prop) => {
222
+ if (prop.type === 'secure' && !isSecretReference(prop.value) && prop.value?.length > 0)
223
223
  secrets.push(['properties', prop.name].join('.').replace(/\s+/g, '+'));
224
224
  });
225
225
 
226
- pipelineData.triggers.forEach((trigger) => {
226
+ pipelineData.triggers?.forEach((trigger) => {
227
227
  if ((trigger?.secret?.type === 'token_matches' || trigger?.secret?.type === 'digest_matches') && !isSecretReference(trigger.secret?.value) && trigger.secret?.value?.length > 0)
228
228
  secrets.push([trigger.name, trigger.secret.key_name].join('.').replace(/\s+/g, '+'));
229
229
  trigger.properties?.forEach((prop) => {
230
- if (prop.type === 'secure' && !isSecretReference(prop.value) && prop.value.length > 0)
230
+ if (prop.type === 'secure' && !isSecretReference(prop.value) && prop.value?.length > 0)
231
231
  secrets.push([trigger.name, 'properties', prop.name].join('.').replace(/\s+/g, '+'));
232
232
  });
233
233
  });
@@ -239,10 +239,14 @@ async function validateTools(token, tcId, region, skipPrompt) {
239
239
  });
240
240
  }
241
241
  if (secrets.length > 0) {
242
+ const MAX_SECRETS_DISPLAY = 10;
243
+ const displaySecrets = secrets.length > MAX_SECRETS_DISPLAY
244
+ ? [...secrets.slice(0, MAX_SECRETS_DISPLAY), `... and ${secrets.length - MAX_SECRETS_DISPLAY} more`]
245
+ : secrets;
242
246
  toolsWithHashedParams.push({
243
247
  tool_name: toolName,
244
248
  type: tool.tool_type_id,
245
- secret_params: secrets,
249
+ secret_params: displaySecrets,
246
250
  url: toolUrl
247
251
  });
248
252
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibm-cloud/cd-tools",
3
- "version": "1.15.22",
3
+ "version": "1.15.23",
4
4
  "description": "Tools and utilities for the IBM Cloud Continuous Delivery service and resources",
5
5
  "repository": {
6
6
  "type": "git",