forked from actions/runner
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be0c2a7
commit cee58eb
Showing
4 changed files
with
123 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Runner.Client | ||
{ | ||
[DataContract] | ||
public enum ActionResultStatus | ||
{ | ||
[EnumMember] | ||
Success = 0, | ||
|
||
[EnumMember] | ||
Failure = 2, | ||
|
||
[EnumMember] | ||
Cancelled = 3, | ||
|
||
[EnumMember] | ||
Skipped = 4, | ||
} | ||
|
||
} |
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,29 @@ | ||
using System.Runtime.Serialization; | ||
using GitHub.DistributedTask.WebApi; | ||
|
||
namespace Runner.Client | ||
{ | ||
public static class ActionResultStatusConverter { | ||
public static ActionResultStatus FromPipelines(TaskResult pipelineStatus) { | ||
ActionResultStatus result = ActionResultStatus.Failure; | ||
switch(pipelineStatus) { | ||
case TaskResult.Failed: | ||
case TaskResult.Abandoned: | ||
result = ActionResultStatus.Failure; | ||
break; | ||
case TaskResult.Canceled: | ||
result = ActionResultStatus.Cancelled; | ||
break; | ||
case TaskResult.Succeeded: | ||
case TaskResult.SucceededWithIssues: | ||
result = ActionResultStatus.Success; | ||
break; | ||
case TaskResult.Skipped: | ||
result = ActionResultStatus.Skipped; | ||
break; | ||
} | ||
return result; | ||
} | ||
} | ||
} | ||
|
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
Oops, something went wrong.