Skip to content

Commit 2ed587f

Browse files
authored
only promote azure cred metadata for cargo ecosystem (#633)
1 parent 690bd07 commit 2ed587f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

cmd/dependabot/internal/cmd/update.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,23 +403,25 @@ func processInput(input *model.Input, flags *UpdateFlags) {
403403

404404
if hasLocalAzureToken && azureRepo != nil {
405405
// Add the Azure Artifacts credentials for each host if the package manager is supported.
406-
if _, ok := azureArtifactsPackageManagerCredentialType[input.Job.PackageManager]; ok {
406+
if credType, ok := azureArtifactsPackageManagerCredentialType[input.Job.PackageManager]; ok {
407407
// All Azure Artifacts hosts
408408
azureArtifactsHosts := []string{
409409
"pkgs.dev.azure.com",
410410
fmt.Sprintf("%s.pkgs.visualstudio.com", azureRepo.Org),
411411
}
412412
for _, host := range azureArtifactsHosts {
413413
input.Credentials = append(input.Credentials, model.Credential{
414-
"type": azureArtifactsPackageManagerCredentialType[input.Job.PackageManager],
414+
"type": credType,
415415
"host": host,
416416
"username": "x-access-token",
417417
"password": "$LOCAL_AZURE_ACCESS_TOKEN",
418418
})
419-
input.Job.CredentialsMetadata = append(input.Job.CredentialsMetadata, model.Credential{
420-
"type": azureArtifactsPackageManagerCredentialType[input.Job.PackageManager],
421-
"host": host,
422-
})
419+
if input.Job.PackageManager == "cargo" {
420+
input.Job.CredentialsMetadata = append(input.Job.CredentialsMetadata, model.Credential{
421+
"type": credType,
422+
"host": host,
423+
})
424+
}
423425
}
424426
} else {
425427
log.Printf("Skipping Azure Artifacts credentials for %s package manager.", input.Job.PackageManager)

0 commit comments

Comments
 (0)