Skip to content

Commit bc5e5ea

Browse files
wjaszczukWiktor Jaszczuk
andauthored
fix: infinite loop while fetching more than one page in remote-cache list-all command (#459)
Co-authored-by: Wiktor Jaszczuk <[email protected]>
1 parent e5784bd commit bc5e5ea

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rnef/provider-github': patch
3+
---
4+
5+
Fix infinite loop in remote-cache list-all command when GH returns more than one page of results

packages/provider-github/src/lib/artifacts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export async function fetchGitHubArtifactsByName(
4141
const result: GitHubArtifact[] = [];
4242
const owner = repoDetails.owner;
4343
const repo = repoDetails.repository;
44-
const url = `https://api.github.com/repos/${owner}/${repo}/actions/artifacts?per_page=${
45-
limit ?? PAGE_SIZE
46-
}&page=${page}${name ? `&name=${name}` : ''}`;
4744

4845
try {
4946
while (true) {
47+
const url = `https://api.github.com/repos/${owner}/${repo}/actions/artifacts?per_page=${
48+
limit ?? PAGE_SIZE
49+
}&page=${page}${name ? `&name=${name}` : ''}`;
5050
let data: GitHubArtifactResponse;
5151
try {
5252
const response = await fetch(url, {

0 commit comments

Comments
 (0)