Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions cmd/dependabot/internal/cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,23 +403,25 @@ func processInput(input *model.Input, flags *UpdateFlags) {

if hasLocalAzureToken && azureRepo != nil {
// Add the Azure Artifacts credentials for each host if the package manager is supported.
if _, ok := azureArtifactsPackageManagerCredentialType[input.Job.PackageManager]; ok {
if credType, ok := azureArtifactsPackageManagerCredentialType[input.Job.PackageManager]; ok {
// All Azure Artifacts hosts
azureArtifactsHosts := []string{
"pkgs.dev.azure.com",
fmt.Sprintf("%s.pkgs.visualstudio.com", azureRepo.Org),
}
for _, host := range azureArtifactsHosts {
input.Credentials = append(input.Credentials, model.Credential{
"type": azureArtifactsPackageManagerCredentialType[input.Job.PackageManager],
"type": credType,
"host": host,
"username": "x-access-token",
"password": "$LOCAL_AZURE_ACCESS_TOKEN",
})
input.Job.CredentialsMetadata = append(input.Job.CredentialsMetadata, model.Credential{
"type": azureArtifactsPackageManagerCredentialType[input.Job.PackageManager],
"host": host,
})
if input.Job.PackageManager == "cargo" {
input.Job.CredentialsMetadata = append(input.Job.CredentialsMetadata, model.Credential{
"type": credType,
"host": host,
})
}
}
} else {
log.Printf("Skipping Azure Artifacts credentials for %s package manager.", input.Job.PackageManager)
Expand Down