Skip to content

Commit 16574e9

Browse files
committed
Enhance artifact link fetching by adding artifact name check and adjusting pagination options
1 parent 5291119 commit 16574e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/flakeguard/cmd/generate_report.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ var GenerateReportCmd = &cobra.Command{
9494
hasFailedTests := summaryData.FailedRuns > 0
9595

9696
var artifactLink string
97-
if hasFailedTests && githubRepo != "" && githubRunID != 0 {
97+
if hasFailedTests && githubRepo != "" && githubRunID != 0 && artifactName != "" {
9898
// Fetch artifact link from GitHub API
9999
artifactLink, err = fetchArtifactLink(githubToken, githubRepo, githubRunID, artifactName)
100100
if err != nil {
@@ -216,7 +216,7 @@ func fetchArtifactLink(githubToken, githubRepo string, githubRunID int64, artifa
216216
owner, repo := repoParts[0], repoParts[1]
217217

218218
// List artifacts for the workflow run
219-
opts := &github.ListOptions{PerPage: 100}
219+
opts := &github.ListOptions{Page: 5, PerPage: 100}
220220
artifacts, _, err := client.Actions.ListWorkflowRunArtifacts(ctx, owner, repo, githubRunID, opts)
221221
if err != nil {
222222
return "", fmt.Errorf("error listing artifacts: %w", err)

0 commit comments

Comments
 (0)