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 #14570

Merged
merged 3 commits into from
May 17, 2017
Merged

GitHub user #14570

merged 3 commits into from
May 17, 2017

Conversation

raphink
Copy link
Contributor

@raphink raphink commented May 17, 2017

This PR adds a github_user data source to the github provider, eg:

data github_user "raphink" {
  username = "raphink"
}
$ terraform state show github_user.raphink
id           = 650430
avatar_url   = https://avatars1.githubusercontent.com/u/650430?v=3
bio          = Automate all the things!

Augeas developer, Puppet contributor, LaTeX fanboy.

Happily working at @camptocamp.
blog         = http://raphink.info
company      = Camptocamp SA
email        = [email protected]
followers    = 105
following    = 57
gravatar_id  = 
location     = Chambéry, France
login        = raphink
name         = Raphaël Pinson
public_gists = 207
public_repos = 236
site_admin   = false
username     = raphink

Copy link
Contributor

@grubernaut grubernaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, minor nit.
Also, would like to have an acceptance test written for this data source, however.

}

func dataSourceGithubUserRead(d *schema.ResourceData, meta interface{}) error {
log.Printf("[INFO] Refreshing Gitub User: %s", d.Id())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On an initial run the id is nil, could change the log statement to print the username as it's a required parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I can use that indeed.

@grubernaut
Copy link
Contributor

Looks good! Just need an acceptance test and we should be good to go, thanks!

@raphink
Copy link
Contributor Author

raphink commented May 17, 2017

@grubernaut there you go!

Copy link
Contributor

@grubernaut grubernaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, looks good. Thanks!

@grubernaut grubernaut merged commit c56ccca into hashicorp:master May 17, 2017
@raphink raphink deleted the github_user branch May 17, 2017 15:40
@ghost
Copy link

ghost commented Apr 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants