From b1fadf1a890eb2da6c7734c8337701aed6cabb07 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Tue, 10 Jan 2023 22:52:12 +0100 Subject: [PATCH] Enable github token --- .github/workflows/continous.yml | 2 +- .nuke/build.schema.json | 4 ---- Build/Build.cs | 9 ++++----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/continous.yml b/.github/workflows/continous.yml index 77aeeca300..fec3d838ba 100644 --- a/.github/workflows/continous.yml +++ b/.github/workflows/continous.yml @@ -44,7 +44,7 @@ jobs: run: ./build.cmd Push SpellCheck env: Nugetapikey: ${{ secrets.NUGETAPIKEY }} - GithubToken: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/upload-artifact@v3 with: name: Artifacts diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 767787bbff..6e143fbd04 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -10,10 +10,6 @@ "type": "boolean", "description": "Indicates to continue a previously failed build attempt" }, - "GithubToken": { - "type": "string", - "default": "Secrets must be entered via 'nuke :secrets [profile]'" - }, "Help": { "type": "boolean", "description": "Shows the help text for this build assembly" diff --git a/Build/Build.cs b/Build/Build.cs index bf0f886298..e8ed381df3 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -38,10 +38,11 @@ }, ImportSecrets = new[] { - nameof(Nugetapikey), nameof(GithubToken) + nameof(Nugetapikey) }, PublishArtifacts = true, AutoGenerate = true, + EnableGitHubToken = true, FetchDepth = 0)] [CustomGitHubActions( name: "unit-tests", @@ -76,14 +77,12 @@ class Build : NukeBuild string BuildNumber => GitHubActions?.RunNumber.ToString(); string PullRequestBase => GitHubActions?.BaseRef; + string GithubToken => GitHubActions?.Token; + [Parameter("The key to push to Nuget")] [Secret] readonly string Nugetapikey; - [Parameter] - [Secret] - readonly string GithubToken; - [Solution(GenerateProjects = true)] readonly Solution Solution;