Skip to content

Commit

Permalink
Allow most workflows to be manually triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Sep 11, 2024
1 parent ca27835 commit 1a639be
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/ghworkflow/workflow_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
func checksWorkflow(cfg core.Configuration) {
ghwCfg := cfg.GitHubWorkflow
w := newWorkflow("Checks", ghwCfg.Global.DefaultBranch, nil)
w.On.WorkflowDispatch.manualTrigger = true
j := baseJobWithGo("Checks", cfg)

j.addStep(jobStep{
Expand Down
2 changes: 2 additions & 0 deletions internal/ghworkflow/workflow_ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func ciWorkflow(cfg core.Configuration) {
if len(ignorePaths) == 0 {
ignorePaths = append(ignorePaths, "**.md")
}

w := newWorkflow("CI", ghwCfg.Global.DefaultBranch, ignorePaths)
w.On.WorkflowDispatch.manualTrigger = true

if w.deleteIf(ghwCfg.CI.Enabled) {
return
Expand Down
1 change: 1 addition & 0 deletions internal/ghworkflow/workflow_codeql.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
func codeQLWorkflow(cfg core.Configuration) {
ghwCfg := cfg.GitHubWorkflow
w := newWorkflow("CodeQL", ghwCfg.Global.DefaultBranch, nil)
w.On.WorkflowDispatch.manualTrigger = true

if w.deleteIf((ghwCfg.SecurityChecks.Enabled == nil || *ghwCfg.SecurityChecks.Enabled)) {
return
Expand Down
5 changes: 3 additions & 2 deletions internal/ghworkflow/workflow_ghcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ func ghcrWorkflow(cfg *core.GithubWorkflowConfiguration) {
return
}

strategy := cfg.PushContainerToGhcr.TagStrategy

w.Permissions.Contents = tokenScopeRead
w.Permissions.Packages = tokenScopeWrite

w.On.Push.Branches = nil
w.On.WorkflowDispatch.manualTrigger = true

strategy := cfg.PushContainerToGhcr.TagStrategy
if slices.Contains(strategy, "edge") {
w.On.Push.Branches = []string{cfg.Global.DefaultBranch}
} else {
Expand Down

0 comments on commit 1a639be

Please sign in to comment.