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

[MAINT]: Make github_ref respect owner (vs taking it from the PAT) #1650

Closed
1 task done
ksatirli opened this issue Apr 13, 2023 · 2 comments · Fixed by #1651
Closed
1 task done

[MAINT]: Make github_ref respect owner (vs taking it from the PAT) #1650

ksatirli opened this issue Apr 13, 2023 · 2 comments · Fixed by #1651
Labels
Status: Triage This is being looked at and prioritized Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Comments

@ksatirli
Copy link
Contributor

Describe the need

Currently, the github_ref data source does not take an owner input and defaults to the one that can be derived from the PAT.

When using the data source with a personal access token (for my user ksatirli), this results in an empty response for a github_ref for hashicorp/setup-terraform:

data "github_ref" "terraform" {
  ref        = "tags/v2.0.3"
  owner      = "hashicorp"
  repository = "setup-terraform"
}

Output:

  "etag" = tostring(null)
  "id" = tostring(null)
  "ref" = tostring(null)
  "repository" = tostring(null)
  "sha" = tostring(null)

Comparatively: when I poll a repository that belongs to the same owner as the PAT, the data source works as expected.

Change request: The github_ref data source should support an owner attribute that is used to query the GH API.

SDK Version

5.22.0 and earlier

API Version

n/a

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ksatirli ksatirli added Status: Triage This is being looked at and prioritized Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR labels Apr 13, 2023
@ivica3730k
Copy link

Thank you very much @ksatirli, this will be very useful.

I guess that the owner in this case can also be an organization?

Thank you!

@kfcampbell
Copy link
Member

Yep! In the context of the provider, "owner" means either a user account or an organization.

@kfcampbell kfcampbell moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active Apr 17, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in 🧰 Octokit Active Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants