Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error querying github_workflow for repository that contains dynamic workflows Closes #410 #412

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion github/table_github_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading