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

github_user data source should support current authenticated user #260

Closed
mithun opened this issue Jul 21, 2019 · 2 comments
Closed

github_user data source should support current authenticated user #260

mithun opened this issue Jul 21, 2019 · 2 comments
Labels
Status: Stale Used by stalebot to clean house Type: Feature New feature or request Upstream

Comments

@mithun
Copy link
Contributor

mithun commented Jul 21, 2019

Terraform Version

$ terraform version
Terraform v0.12.5
+ provider.github v2.2.0

Affected Resource(s)

  • github_user data source

Terraform Configuration Files

provider "github" {
  individual = true
  version    = "2.2.0"
}

data "github_user" "current" {
  username = ""
}

output "github_current_login" {
  value = data.github_user.current.login
}

Expected Behavior

The current authenticated user's github login is printed as a terraform output.

Actual Behavior

$ terraform apply
data.github_user.current: Refreshing state...

Error: GET https://api.github.com/user/gpg_keys: 404 Not Found []

  on main.tf line 6, in data "github_user" "current":
   6: data "github_user" "current" {

Steps to Reproduce

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

  1. terraform apply

Important Factoids

go-github/v27 allows using an empty string for the username to fetch the current user's details. This API call seems successful. However, the API calls to get GPG and SSH seems to be using the username argument which can be an empty string.

@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 Dec 11, 2022
@kfcampbell
Copy link
Member

Closing this as #261 has been merged. Please reopen if this is in error!

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 Type: Feature New feature or request Upstream
Projects
None yet
Development

No branches or pull requests

3 participants