pulumi / pulumi-github

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

[GitHub]: cannot create release . 422 #718

Closed VladimirCreator closed 1 week ago

VladimirCreator commented 1 month ago

Expected behavior

The release should be created

I just created a release (actually an example from Pulumi GitHub Docs):

const v_1_0_0 = new github.Release("res", {
    repository: repo.name
    tagName: "v1.0.0"
})

Current behavior

It throws error 422.

The strange thing is that preview succeeds, but deployment fails.

Steps to reproduce

  1. Create a repo
  2. Create a release via code
  3. Trigger deployment on Pulumi Cloud (git push)

Extra

I am able to create other types of resources.

komalali commented 1 month ago

It looks like you're running into an issue with the pulumi-github provider. Are you sure the tag that you're trying to release actually exists?

Either way, I will transfer this to the pulumi-github repo where it is more relevant.

VladimirCreator commented 1 month ago

The assumption was that it will automatically create the tag.

In any case, creating the tag and triggering deployment results the same error:

https://api.github.com/repos/:myname/:myrepo/releases: 422 Validation Failed [{Resource:Release Field:target_commitish Code:invalid Message:}]

Thanks for transferring the issue, btw!

VenelinMartinov commented 1 month ago

Thanks for reporting @VladimirCreator.

I had a go at reproing this and it seems to work fine with this code:

name: github_718
runtime: yaml
resources:
  example:
    type: github:Repository
    properties:
      name: repo
  exampleRelease:
    type: github:Release
    properties:
      repository: ${example.name}
      tagName: v1.0.9

I suspect the error depends on the repository configuration, can you please provide some details about how the repository was set up so we can reproduce the problem?

Does the repo have a default branch set up? targetCommitish defaults to that: https://www.pulumi.com/registry/packages/github/api-docs/release/#targetcommitish_yaml

mjeffryes commented 1 week ago

closing due to inactivity