-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
bootstrap.cake
24 lines (19 loc) · 760 Bytes
/
bootstrap.cake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#addin "nuget:?package=Scriban&version=5.0.0"
using Scriban;
Task("Generate-Secrets")
.Does(ctx =>
{
var clientId = Argument<string>("client-id");
var clientSecret = Argument<string>("client-secret");
var template = Template.Parse(System.IO.File.ReadAllText("./eng/templates/secrets.scriban"));
// Render template
var result = template.Render(new { ClientId = clientId, ClientSecret = clientSecret });
if (result == null)
{
throw new InvalidOperationException("An error occured while rendering template");
}
// Write result
var output = MakeAbsolute(File("./src/Ghostly.Github/GitHubSecrets.Generated.cs"));
System.IO.File.WriteAllText(output.FullPath, result);
});
RunTarget("Generate-Secrets");