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
2915ead
commit 3d5eef5
Showing
8 changed files
with
309 additions
and
48 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
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,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
using Newtonsoft.Json; | ||
|
||
namespace Sdk.Actions { | ||
|
||
public class PipelinesDescriptions | ||
{ | ||
|
||
public static Dictionary<string, TSource> ToOrdinalIgnoreCaseDictionary<TSource>(IEnumerable<KeyValuePair<string, TSource>> source) { | ||
var ret = new Dictionary<string, TSource>(StringComparer.OrdinalIgnoreCase); | ||
foreach(var kv in source) { | ||
ret[kv.Key] = kv.Value; | ||
} | ||
return ret; | ||
} | ||
|
||
public string Description { get; set; } | ||
|
||
public Dictionary<string, string> Versions { get; set; } | ||
public static Dictionary<string, Dictionary<string, PipelinesDescriptions>> LoadDescriptions() { | ||
var assembly = Assembly.GetExecutingAssembly(); | ||
var json = default(String); | ||
using (var stream = assembly.GetManifestResourceStream("pipelines.descriptions.json")) | ||
using (var streamReader = new StreamReader(stream)) | ||
{ | ||
json = streamReader.ReadToEnd(); | ||
} | ||
|
||
return ToOrdinalIgnoreCaseDictionary(JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, PipelinesDescriptions>>>(json).Select(kv => new KeyValuePair<string, Dictionary<string, PipelinesDescriptions>>(kv.Key, ToOrdinalIgnoreCaseDictionary(kv.Value)))); | ||
} | ||
} | ||
|
||
} |
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
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