diff --git a/github/table_github_workflow.go b/github/table_github_workflow.go index 8d578bf..de661d5 100644 --- a/github/table_github_workflow.go +++ b/github/table_github_workflow.go @@ -130,7 +130,10 @@ func GitHubWorkflowFileContent(ctx context.Context, d *plugin.QueryData, h *plug content, _, _, err := client.Repositories.GetContents(ctx, owner, repo, *workflow.Path, &github.RepositoryContentGetOptions{Ref: defaultBranch}) if err != nil { // the workflow object exists, but the file is deleted - if strings.Contains(err.Error(), "404 Not Found") { + // The API throws "404 No commit found" error if there is any dynamic workflow file generated by GitHub action. + // https://github.com/nextstrain/status/issues/6 + // https://github.com/nextstrain/status/pull/7/commits/160eb950235ae81d3d37a990a0715ed815cd7fc9 + if strings.Contains(err.Error(), "404 Not Found") || strings.Contains(err.Error(), "404 No commit found") { return nil, nil } return nil, err