Skip to content

Commit

Permalink
fix: add missing packagist username secret (#1221)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
adaam2 and chase-crumbaugh authored Jan 17, 2025
1 parent eb9902a commit 318006d
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions prompts/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 := &currentPackagistUserName
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":
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 318006d

Please sign in to comment.