-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH Action Build Trigger Selection Added and improved with lipgloss
- Loading branch information
1 parent
db4ce97
commit 359cbb7
Showing
8 changed files
with
122 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,11 @@ | ||
package constants | ||
|
||
import "github.com/charmbracelet/huh" | ||
|
||
const ( | ||
AppCI = "ci" | ||
Deployment = "deployment" | ||
Publish = "publish" | ||
) | ||
ActionTypeAppCI = "Continuous Integration (CI)" | ||
ActionTypeDeployment = "Continuous Deployment (CD)" | ||
ActionTypePublish = "Publish Package" | ||
|
||
func GetActionTypeOptions(actionType string) []huh.Option[string] { | ||
switch actionType { | ||
case AppCI: | ||
return GetAppCIOptions() | ||
case Deployment: | ||
return nil | ||
case Publish: | ||
return nil | ||
default: | ||
return nil | ||
} | ||
} | ||
TriggerOnCommit = "OnCommit" | ||
TriggerOnWorkflowDispatch = "OnWorkflowDispatch" | ||
TriggerOnPullRequest = "OnPullRequest" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package options | ||
|
||
import ( | ||
"github.com/chamodshehanka/gh-action-gen/internal/constants" | ||
"github.com/charmbracelet/huh" | ||
) | ||
|
||
func GetActionTypeOptions(actionType string) []huh.Option[string] { | ||
switch actionType { | ||
case constants.ActionTypeAppCI: | ||
return GetAppCIOptions() | ||
case constants.ActionTypeDeployment: | ||
return nil | ||
case constants.ActionTypePublish: | ||
return nil | ||
default: | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package utils | ||
|
||
func StringArrayToString(array []string) string { | ||
triggerString := "" | ||
for _, trigger := range array { | ||
triggerString += trigger + ", " | ||
} | ||
|
||
// Remove the trailing comma and space | ||
if len(triggerString) > 0 { | ||
triggerString = triggerString[:len(triggerString)-2] | ||
} | ||
|
||
return triggerString | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters