Skip to content

Commit

Permalink
Merge pull request integrations#93 from sethvargo/sethvargo/html_url
Browse files Browse the repository at this point in the history
Add html_url to github_repository
  • Loading branch information
paultyng authored May 11, 2018
2 parents a9db398 + a0cb113 commit 549a125
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions github/resource_github_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ func resourceGithubRepository() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"html_url": {
Type: schema.TypeString,
Computed: true,
},
"ssh_clone_url": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -198,6 +202,7 @@ func resourceGithubRepositoryRead(d *schema.ResourceData, meta interface{}) erro
d.Set("has_downloads", repo.HasDownloads)
d.Set("full_name", repo.FullName)
d.Set("default_branch", repo.DefaultBranch)
d.Set("html_url", repo.HTMLURL)
d.Set("ssh_clone_url", repo.SSHURL)
d.Set("svn_url", repo.SVNURL)
d.Set("git_clone_url", repo.GitURL)
Expand Down
3 changes: 3 additions & 0 deletions github/resource_github_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ func testAccCheckGithubRepositoryAttributes(repo *github.Repository, want *testA
if !strings.HasPrefix(*repo.CloneURL, "https://") {
return fmt.Errorf("got Clone URL %q; want to start with 'https://'", *repo.CloneURL)
}
if !strings.HasSuffix(*repo.HTMLURL, "/"+want.Name) {
return fmt.Errorf("got HTML URL %q; want to end with '%s'", *repo.HTMLURL, want.Name)
}
if !strings.HasSuffix(*repo.SSHURL, "/"+want.Name+".git") {
return fmt.Errorf("got SSH URL %q; want to end with '/%s.git'", *repo.SSHURL, want.Name)
}
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/repository.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ The following additional attributes are exported:

* `full_name` - A string of the form "orgname/reponame".

* `html_url` - URL to the repository on the web.

* `ssh_clone_url` - URL that can be provided to `git clone` to clone the
repository via SSH.

Expand Down

0 comments on commit 549a125

Please sign in to comment.