From 318006d85e7b2b77b4c2a0e3a83b5010340e6465 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 17 Jan 2025 16:46:53 +0000 Subject: [PATCH] fix: add missing packagist username secret (#1221) The username is required param for the packagist API ![image](https://github.com/user-attachments/assets/82e3c83f-7a13-4bb7-ae6f-bdda1ce3e978) --------- Co-authored-by: Robert Crumbaugh --- prompts/github.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/prompts/github.go b/prompts/github.go index d318badd..84a50973 100644 --- a/prompts/github.go +++ b/prompts/github.go @@ -27,6 +27,7 @@ const ( nugetTokenDefault = "NUGET_API_KEY" rubyGemsTokenDefault = "RUBYGEMS_AUTH_TOKEN" packagistTokenDefault = "PACKAGIST_TOKEN" + packagistUsernameDefault = "PACKAGIST_USERNAME" ossrhPasswordDefault = "OSSRH_PASSWORD" osshrUsernameDefault = "OSSRH_USERNAME" gpgSecretKeyDefault = "JAVA_GPG_SECRET_KEY" @@ -130,22 +131,10 @@ func ConfigurePublishing(target *workflow.Target, name string) (*workflow.Target }, } case "php": - currentPackagistUserName := "" - if target.Publishing != nil && target.Publishing.Packagist != nil { - currentPackagistUserName = target.Publishing.Packagist.Username - } - packagistUsername := ¤tPackagistUserName - promptMap[publishingPrompt{ - key: "Packagist Username", - entryType: publishingTypeValue, - }] = packagistUsername - if err := executePromptsForPublishing(promptMap, target, name); err != nil { - return nil, err - } target.Publishing = &workflow.Publishing{ Packagist: &workflow.Packagist{ Token: formatWorkflowSecret(packagistTokenDefault), - Username: *packagistUsername, + Username: formatWorkflowSecret(packagistUsernameDefault), }, } case "java": @@ -336,6 +325,7 @@ func getSecretsValuesFromPublishing(publishing workflow.Publishing) []string { if publishing.Packagist != nil { secrets = append(secrets, publishing.Packagist.Token) + secrets = append(secrets, publishing.Packagist.Username) } if publishing.Java != nil {