Skip to content

Commit

Permalink
fix log downloading in GH orchestrator (#4683)
Browse files Browse the repository at this point in the history
Co-authored-by: Gulom Alimov <[email protected]>
  • Loading branch information
Googlom and Gulom Alimov authored Nov 23, 2023
1 parent 0d6fb16 commit 0006f10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/orchestrator/gitHubActions.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ func (g *GitHubActionsConfigProvider) GetLog() ([]byte, error) {
wg.Go(func() error {
_, resp, err := g.client.Actions.GetWorkflowJobLogs(g.ctx, g.owner, g.repo, jobs[i].ID, true)
if err != nil {
return errors.Wrap(err, "fetching job logs failed")
// GetWorkflowJobLogs returns "200 OK" as error when log download is successful.
// Therefore, ignore this error.
// GitHub API returns redirect URL instead of plain text logs. See:
// https://docs.github.com/en/[email protected]/rest/actions/workflow-jobs?apiVersion=2022-11-28#download-job-logs-for-a-workflow-run
if err.Error() != "unexpected status code: 200 OK" {
return errors.Wrap(err, "fetching job logs failed")
}
}
defer resp.Body.Close()

Expand Down

0 comments on commit 0006f10

Please sign in to comment.