Skip to content

Commit

Permalink
Fix GitHub rate limit errors in Create Release Candidate workflow. (#475
Browse files Browse the repository at this point in the history
)

Fixes #139

Signed-off-by: Thomas Farr <[email protected]>
(cherry picked from commit 2c54a95)
  • Loading branch information
Xtansia authored and github-actions[bot] committed Sep 16, 2024
1 parent 71954ea commit cf5b7ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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

0 comments on commit cf5b7ad

Please sign in to comment.