-
Notifications
You must be signed in to change notification settings - Fork 945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Conditional Steps in Composite Actions #1438
Changes from 15 commits
f11df5b
7278a46
0a79f90
9f6df00
ef46c42
3e068ec
e820233
c41547d
6b139bf
6f683bd
02bf28d
2386007
e6ac2cb
8590f2e
1fae86a
9c57bff
c412713
7668c2f
c8d6db8
3e7f9a3
71949db
b2306dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,19 @@ protected sealed override object EvaluateCore(EvaluationContext evaluationContex | |
ArgUtil.NotNull(templateContext, nameof(templateContext)); | ||
var executionContext = templateContext.State[nameof(IExecutionContext)] as IExecutionContext; | ||
ArgUtil.NotNull(executionContext, nameof(executionContext)); | ||
ActionResult jobStatus = executionContext.JobContext.Status ?? ActionResult.Success; | ||
return jobStatus == ActionResult.Failure; | ||
|
||
// Decide based on 'action_status' for composite MAIN steps and 'job.status' for pre, post and job-level steps | ||
var isCompositeMainStep = executionContext.IsEmbedded && executionContext.Stage == ActionRunStage.Main; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add some L0 for these new functions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other than Success and Failure, we've got
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added L0s for Success and Failure |
||
if (isCompositeMainStep) | ||
{ | ||
ActionResult actionStatus = EnumUtil.TryParse<ActionResult>(executionContext.GetGitHubContext("action_status")) ?? ActionResult.Success; | ||
return actionStatus == ActionResult.Failure; | ||
} | ||
else | ||
{ | ||
ActionResult jobStatus = executionContext.JobContext.Status ?? ActionResult.Success; | ||
return jobStatus == ActionResult.Failure; | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need the FF in the runner? I guess the answer might be yes for older version GHES.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose when we do remove the FF we would search the runner for its references, not sure if leaving the
TODO
made sense.