Skip to content

Commit

Permalink
ci: look at all the branches (#12072)
Browse files Browse the repository at this point in the history
By default, github only returns the first thirty branches from this API, notably excluding any that we're looking for.
  • Loading branch information
Ruben-VandeVelde committed Apr 11, 2024
1 parent 488eafd commit 5dd5b45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/nightly_detect_failure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,17 @@ jobs:
uses: actions/github-script@v5
with:
script: |
const branches = await github.rest.repos.listBranches({
const branches = await github.paginate(github.rest.repos.listBranches, {
owner: context.repo.owner,
repo: context.repo.repo
});
const bumpBranches = branches.data
.map(branch => branch.name)
.filter(name => name.match(/^bump\/v4\.\d+\.0$/))
.sort((a, b) => b.localeCompare(a, undefined, {numeric: true, sensitivity: 'base'}));
if (!bumpBranches.length) {
throw new Exception("Did not find any bump/v4.x.0 branch")
}
const latestBranch = bumpBranches[0];
return latestBranch;
Expand Down

0 comments on commit 5dd5b45

Please sign in to comment.