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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing stack with an org secret in it deleted the secret from the stack (but not GitHub) when it shouldn't have #156

Open
pierskarsenbarg opened this issue Oct 14, 2021 · 1 comment
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@pierskarsenbarg
Copy link
Member

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

When creating an organization secret and assigning it to a repository, then refreshing the stack the secret resource is deleted from the stack but not from GitHub. Also, the secret should never be deleted from the stack or GitHub, we're just running a refresh

Steps to reproduce

  1. Clone this repo: https://github.com/pierskarsenbarg/github-secrets
  2. Add org name and GitHub access token to config (pulumi config set github:owner {organization name} followed by pulumi config set github:token {token} - token can be created from here)
  3. Run pulumi up to create resources
  4. Run pulumi refresh without changing anything. You'll see the ActionsOrganizationSecret marked for deletion. If you then select yes you'll see that the resource is deleted from the stack, but if you look at the organization secrets in GitHub, you'll see that the secret is still there

Expected:

Nothing to happen

Actual:

GitHub org secret resource is deleted from the stack

@pierskarsenbarg pierskarsenbarg added the kind/bug Some behavior is incorrect or out of spec label Oct 14, 2021
@MitchellGerdisch
Copy link

This is an issue from the underlying TF provider:
integrations/terraform-provider-github#974

You can work around this bug by using the embedded selectedRepositoryIds in the ActionsOrganizationSecret resource itself instead of using the separate ActionsOrganizationSecretRepositories resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants