Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GitHub rate limit errors in Create Release Candidate workflow #475

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions build/scripts/Commandline.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
12 changes: 9 additions & 3 deletions build/scripts/ReleaseNotes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading