pulumi / pulumi-github

A Pulumi package to facilitate interacting with GitHub
Apache License 2.0
58 stars 10 forks source link

ActionsEnvironmentSecret ignores github:owner config #246

Closed anthonator closed 2 days ago

anthonator commented 1 year ago

What happened?

When trying to replace an ActionsEnvironmentSecret we get the following error.

Diagnostics:
  github:index:ActionsEnvironmentSecret (lokiAWSSecretAccessKey):
    error: deleting urn:pulumi:loki-production::loki::github:index/actionsEnvironmentSecret:ActionsEnvironmentSecret::lokiAWSSecretAccessKey: GET https://api.github.com/repos//<repo>: 404 Not Found []

  pulumi:pulumi:Stack (loki-loki-production):
    error: update failed

Steps to reproduce

Attempt to use ActionsEnvironmentSecret.

return new github.ActionsEnvironmentSecret(
  "lokiAWSSecretAccessKey",
  {
    environment,
    encryptedValue,
    repository,
    secretName,
  },
  {
    deleteBeforeReplace: true,
  }
);

Expected Behavior

The ActionsEnvironmentSecret is replaced.

Actual Behavior

We get the error provided as part of the answer to the "What happened?" question.

Output of pulumi about

CLI          
Version      3.40.2
Go Version   go1.19.1
Go Compiler  gc

Plugins
NAME    VERSION
nodejs  unknown

Host     
OS       darwin
Version  12.5.1
Arch     x86_64

This project is written in nodejs: executable='/Users/tyranthosaur/.asdf/shims/node' version='v18.6.0'

Current Stack: loki-production

TYPE                                                            URN
pulumi:pulumi:Stack                                             urn:pulumi:loki-production::loki::pulumi:pulumi:Stack::loki-loki-production
pulumi:providers:github                                         urn:pulumi:loki-production::loki::pulumi:providers:github::default_5_0_0
pulumi:providers:aws                                            urn:pulumi:loki-production::loki::pulumi:providers:aws::default_5_16_0
aws:s3/bucket:Bucket                                            urn:pulumi:loki-production::loki::aws:s3/bucket:Bucket::loki
aws:iam/user:User                                               urn:pulumi:loki-production::loki::aws:iam/user:User::loki
aws:iam/userPolicy:UserPolicy                                   urn:pulumi:loki-production::loki::aws:iam/userPolicy:UserPolicy::loki
aws:iam/accessKey:AccessKey                                     urn:pulumi:loki-production::loki::aws:iam/accessKey:AccessKey::loki
github:index/actionsEnvironmentSecret:ActionsEnvironmentSecret  urn:pulumi:loki-production::loki::github:index/actionsEnvironmentSecret:ActionsEnvironmentSecret::lokiAWSAccessKeyId
pulumi:providers:aws                                            urn:pulumi:loki-production::loki::pulumi:providers:aws::default_5_10_0
pulumi:providers:github                                         urn:pulumi:loki-production::loki::pulumi:providers:github::default_4_15_1
github:index/actionsEnvironmentSecret:ActionsEnvironmentSecret  urn:pulumi:loki-production::loki::github:index/actionsEnvironmentSecret:ActionsEnvironmentSecret::lokiAWSSecretAccessKey

Additional context

No response

Contributing

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).

lblackstone commented 1 year ago

Could this be related to https://github.com/integrations/terraform-provider-github/issues/578?

https://github.com/integrations/terraform-provider-github/issues/578#issuecomment-1078827934 suggests setting the owner field of the Provider configuration as a workaround.

anthonator commented 1 year ago

We have github:owner set in our configuration. This was working properly only until recently.

anthonator commented 1 year ago

We also tried the following with the same error.

github.getActionsPublicKey({
  repository: `ownername/${repository}`,
});
smith558 commented 1 week ago

We also tried the following with the same error.

github.getActionsPublicKey({
  repository: `ownername/${repository}`,
});

I had an identical issue. I've resolved it by following the instructions here https://www.pulumi.com/registry/packages/github/installation-configuration/#configuring-credentials.

guineveresaenger commented 2 days ago

@smith558 thank you for providing this context. It does seem like this issue is resolved?

Please feel fee to re-open if there are any remaining concerns, or if there is any way in which we can provide better messaging here in the future. If you do so, could you please provide us with a full program that minimally reproduces this behavior? 🙏