diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83fbba158c..ed909b179e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,8 @@ jobs: - name: Generate Release run: | ./build.sh release $VERSION + env: + GITHUB_TOKEN: ${{ github.token }} - uses: actions/upload-artifact@v2 with: name: opensearch-net-${{env.VERSION}}-release-candidate diff --git a/build/scripts/Commandline.fs b/build/scripts/Commandline.fs index 23f7edf9b7..5045e98fc0 100644 --- a/build/scripts/Commandline.fs +++ b/build/scripts/Commandline.fs @@ -29,9 +29,7 @@ namespace Scripts open System open System.Runtime.InteropServices -open Fake.Core open Fake.IO -open Octokit //this is ugly but a direct port of what used to be duplicated in our DOS and bash scripts module Commandline = diff --git a/build/scripts/ReleaseNotes.fs b/build/scripts/ReleaseNotes.fs index ae856b11f1..1eff012b12 100644 --- a/build/scripts/ReleaseNotes.fs +++ b/build/scripts/ReleaseNotes.fs @@ -27,11 +27,12 @@ namespace Scripts +open System open System.Collections.Generic open System.Linq open System.IO open System.Text.RegularExpressions -open System.Text; +open System.Text open Octokit open Versioning @@ -137,8 +138,13 @@ module ReleaseNotes = filter.Labels.Add label filter.State <- ItemStateFilter.Closed - let client = GitHubClient(ProductHeaderValue("ReleaseNotesGenerator")) - client.Credentials <- Credentials.Anonymous + let client = GitHubClient(ProductHeaderValue("ReleaseNotesGenerator")) + + client.Credentials <- + Environment.GetEnvironmentVariable("GITHUB_TOKEN") + |> Option.ofObj + |> Option.map (fun token -> Credentials(token)) + |> Option.defaultValue Credentials.Anonymous client.Issue.GetAllForRepository(Paths.GitHubOwnerName, Paths.GitHubRepositoryName, filter) |> Async.AwaitTask