mirror of
https://github.com/thegeeklab/drone-yaml.git
synced 2024-11-22 01:50:40 +00:00
added action to when clause
This commit is contained in:
parent
a338c245d7
commit
4889634ea9
@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
|
- Added Action field to trigger and when clause, by [@bradrydzewski](https://github.com/bradrydzewski).
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import filepath "github.com/bmatcuk/doublestar"
|
|||||||
|
|
||||||
// Conditions defines a group of conditions.
|
// Conditions defines a group of conditions.
|
||||||
type Conditions struct {
|
type Conditions struct {
|
||||||
|
Action Condition `json:"action,omitempty"`
|
||||||
Cron Condition `json:"cron,omitempty"`
|
Cron Condition `json:"cron,omitempty"`
|
||||||
Ref Condition `json:"ref,omitempty"`
|
Ref Condition `json:"ref,omitempty"`
|
||||||
Repo Condition `json:"repo,omitempty"`
|
Repo Condition `json:"repo,omitempty"`
|
||||||
|
@ -122,6 +122,9 @@ func printConcurrency(w writer, v yaml.Concurrency) {
|
|||||||
func printConditions(w writer, name string, v yaml.Conditions) {
|
func printConditions(w writer, name string, v yaml.Conditions) {
|
||||||
w.WriteTag(name)
|
w.WriteTag(name)
|
||||||
w.IndentIncrease()
|
w.IndentIncrease()
|
||||||
|
if !isConditionEmpty(v.Action) {
|
||||||
|
printCondition(w, "action", v.Action)
|
||||||
|
}
|
||||||
if !isConditionEmpty(v.Branch) {
|
if !isConditionEmpty(v.Branch) {
|
||||||
printCondition(w, "branch", v.Branch)
|
printCondition(w, "branch", v.Branch)
|
||||||
}
|
}
|
||||||
@ -276,7 +279,9 @@ func isConcurrencyEmpty(v yaml.Concurrency) bool {
|
|||||||
// helper function returns true if the conditions
|
// helper function returns true if the conditions
|
||||||
// object is empty.
|
// object is empty.
|
||||||
func isConditionsEmpty(v yaml.Conditions) bool {
|
func isConditionsEmpty(v yaml.Conditions) bool {
|
||||||
return isConditionEmpty(v.Branch) &&
|
return isConditionEmpty(v.Action) &&
|
||||||
|
isConditionEmpty(v.Branch) &&
|
||||||
|
isConditionEmpty(v.Cron) &&
|
||||||
isConditionEmpty(v.Event) &&
|
isConditionEmpty(v.Event) &&
|
||||||
isConditionEmpty(v.Instance) &&
|
isConditionEmpty(v.Instance) &&
|
||||||
isConditionEmpty(v.Paths) &&
|
isConditionEmpty(v.Paths) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user