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

Add import function for github_actions_organization_secret resource #745

Merged
merged 2 commits into from
Apr 17, 2021

Conversation

xun-guo-anzx
Copy link
Contributor

Use Cases

Importer function will be useful when migrating existing Github organisational secrets to Terraform resources. This will allow importing existing organisation secrets into Terraform state along with it's visibility status and list of repositories when visibility is selected.

One defect of this implementation is it won't fetch value for plaintext_value for the secret to the state file. So would recommend using this along with resources ignoring changes for plaintext_value.

Changes include:

  • Create importer function for resource github_actions_organization_secret
  • Import organization secrets along with selected repository IDs list if visibility is selected

* Import organization secrets along with selected repository IDs list if visibility is selected
* Ignore change for plaintext_value because it won't be fetched from Github API
@xun-guo-anzx xun-guo-anzx force-pushed the actions-org-secret-import branch from ce31ea6 to 6bf374c Compare March 30, 2021 06:01
@jcudit jcudit added this to the v4.7.0 milestone Apr 6, 2021
Copy link
Contributor

@jcudit jcudit left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! A couple of things:

  • Can you cherry-pick 0d5bf21 to pull in tests and docs for this?
  • I think 👇🏾 is OK to document and defer until we see friction reported by the community.

    One defect of this implementation is it won't fetch value for plaintext_value for the secret to the state file. So would recommend using this along with resources ignoring changes for plaintext_value.

@jcudit jcudit modified the milestones: v4.7.0, v4.8.0 Apr 6, 2021
@xun-guo-anzx
Copy link
Contributor Author

Thanks @jcudit for update and recommendation. I've updated the branch with cherry-picked commit.

@jcudit jcudit merged commit 6c20aa0 into integrations:master Apr 17, 2021
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
…ntegrations#745)

* Add import function for github_actions_organization_secret resource
* Import organization secrets along with selected repository IDs list if visibility is selected
* Ignore change for plaintext_value because it won't be fetched from Github API

* add test / docs for importing `github_actions_organization_secret`

Co-authored-by: Jeremy Udit <jcudit@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants