cloudformation-github-resource-providers icon indicating copy to clipboard operation
cloudformation-github-resource-providers copied to clipboard

fix for being unable to rename github repo

Open zan-mateusz opened this issue 2 years ago • 0 comments

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Notes.

  • The Name property was in the list of createOnlyProperties. Removed that so it can be used in update operation
  • The default api user path using the owner and name properties. This has caused issues when trying to update since the name was primaryIdentifier and therefore even though it was specified in update input, it used original value. If name was removed from primaryIdentifier list, it would be unable to call the api correctly for GET handler.
  • Fortunately, there is an alternative that allows us to call the api with the ID instead of owner and name: see here for more reference: https://github.com/piotrmurach/github/issues/282
  • Therefore, adding the ID as read only parameter and making that ID a primaryIdentifier, then calling the alternative API makes this work as expected, allowing for renaming
  • Since we use octokit endpoints, had to use ts-ignore, as the alternative api method is not part of endpoints interface in octokit - however it works as expected

zan-mateusz avatar Nov 03 '23 16:11 zan-mateusz