Skip to content

Commit

Permalink
fix: setup defaults
Browse files Browse the repository at this point in the history
If no pre-if or post-if is given, it should default to 'always()'.
This could be set even if there is no pre or post step.
In fact this is required for composite actions and included post
steps to run.
  • Loading branch information
KnisterPeter authored and github-actions committed May 19, 2022
1 parent 6cae9cd commit f79fde0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/model/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ func ReadAction(in io.Reader) (*Action, error) {
}

// set defaults
if a.Runs.Pre != "" && a.Runs.PreIf == "" {
if a.Runs.PreIf == "" {
a.Runs.PreIf = "always()"
}
if a.Runs.Post != "" && a.Runs.PostIf == "" {
if a.Runs.PostIf == "" {
a.Runs.PostIf = "always()"
}

Expand Down

0 comments on commit f79fde0

Please sign in to comment.