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

data source github_repositories - query returns empty result when using "filename:" filter #1148

Closed
mwos-sl opened this issue May 13, 2022 · 3 comments
Labels
Status: Stale Used by stalebot to clean house

Comments

@mwos-sl
Copy link

mwos-sl commented May 13, 2022

Terraform Version

Terraform v1.0.7
on darwin_amd64

  • provider registry.terraform.io/hashicorp/aws v4.13.0
  • provider registry.terraform.io/integrations/github v4.24.1

Affected Resource(s)

data "github_repositories"

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

data "github_repositories" "repos" {
  query = "org:integrations filename:README.md"
}

output "repos" {
  value = data.github_repositories.repos.names
}

When using just query = "org:integrations" it indeed returns all non-forked repositories - cool. But after adding filename:README.md filter - it stops working.

Expected Behavior

Return all repositories which contains a given file (README.md in this case), same way the github search does:
image

Actual Behavior

Github provider returns empty list.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

Important Factoids

@mwos-sl
Copy link
Author

mwos-sl commented May 13, 2022

Relevant piece of documentation: https://docs.github.com/en/search-github/searching-on-github/searching-code#search-by-filename

This bug is even more painful because there is no way currently to check if a given file exist in a given repo (#1131).

@mwos-sl
Copy link
Author

mwos-sl commented May 17, 2022

EDIT: Actually Github search does not respect filename filter at all even when using in GitHub UI, and returns all the results (reminder - while querying via terraform it returns none of the results which is opposite).
I created GitHub support ticket for this, but I'm afraid it's not public :(

@github-actions
Copy link

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Feb 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Used by stalebot to clean house
Projects
None yet
Development

No branches or pull requests

1 participant