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.
* fix conditionally assign variable * azexpand and azpipelines are now subcommands
- Loading branch information
1 parent
e88755b
commit 72ec97c
Showing
6 changed files
with
238 additions
and
110 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,24 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using GitHub.DistributedTask.ObjectTemplating; | ||
using GitHub.DistributedTask.ObjectTemplating.Tokens; | ||
using GitHub.DistributedTask.Pipelines.ObjectTemplating; | ||
|
||
namespace Runner.Server.Azure.Devops { | ||
|
||
public class AzurePipelinesUtils { | ||
public static TemplateToken ConvertStringToTemplateToken(string res) { | ||
if(res == null) { | ||
return null; | ||
} | ||
var templateContext = AzureDevops.CreateTemplateContext(new EmptyTraceWriter(), new List<string>(), GitHub.DistributedTask.Expressions2.ExpressionFlags.DTExpressionsV1 | GitHub.DistributedTask.Expressions2.ExpressionFlags.ExtendedDirectives); | ||
using (var stringReader = new StringReader(res)) | ||
{ | ||
var yamlObjectReader = new YamlObjectReader(null, stringReader, preserveString: true, forceAzurePipelines: true); | ||
var ret = TemplateReader.Read(templateContext, "any", yamlObjectReader, null, out _); | ||
templateContext.Errors.Check(); | ||
return ret; | ||
} | ||
} | ||
} | ||
} |
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
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