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

resource/actions_secret and data-source/actions_public_key: add individual user support #520

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions github/data_source_github_actions_public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ func dataSourceGithubActionsPublicKey() *schema.Resource {
}

func dataSourceGithubActionsPublicKeyRead(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

repository := d.Get("repository").(string)
owner := meta.(*Owner).name
log.Printf("[INFO] Refreshing GitHub Actions Public Key from: %s/%s", owner, repository)
Expand Down
8 changes: 0 additions & 8 deletions github/data_source_github_actions_public_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import (
)

func TestAccGithubActionsPublicKeyDataSource_noMatchReturnsError(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

repo := "non-existent"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
Expand All @@ -30,10 +26,6 @@ func TestAccGithubActionsPublicKeyDataSource_noMatchReturnsError(t *testing.T) {
}

func TestAccCheckGithubActionsPublicKeyDataSource_existing(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

repo := os.Getenv("GITHUB_TEMPLATE_REPOSITORY")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
Expand Down
15 changes: 0 additions & 15 deletions github/resource_github_actions_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ func resourceGithubActionsSecret() *schema.Resource {
}

func resourceGithubActionsSecretCreateOrUpdate(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
owner := meta.(*Owner).name
ctx := context.Background()
Expand Down Expand Up @@ -86,11 +81,6 @@ func resourceGithubActionsSecretCreateOrUpdate(d *schema.ResourceData, meta inte
}

func resourceGithubActionsSecretRead(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
owner := meta.(*Owner).name
ctx := context.Background()
Expand Down Expand Up @@ -121,11 +111,6 @@ func resourceGithubActionsSecretRead(d *schema.ResourceData, meta interface{}) e
}

func resourceGithubActionsSecretDelete(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
orgName := meta.(*Owner).name
ctx := context.WithValue(context.Background(), ctxId, d.Id())
Expand Down
4 changes: 0 additions & 4 deletions github/resource_github_actions_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import (
)

func TestAccGithubActionsSecret_basic(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

repo := acctest.RandomWithPrefix("tf-acc-test")

secretResourceName := "github_actions_secret.test_secret"
Expand Down