squidfunk / terraform-aws-github-ci

[DEPRECATED] Serverless CI for GitHub using AWS CodeBuild with PR and status support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub services hook deprecated

Stretch96 opened this issue · comments

Description

When running terraform apply:

github_repository_webhook._: POST https://api.github.com/repos/owner/repo/hooks: /hooks: 422 As of October 2018, GitHub Services can no longer be added. Please see the blog post for details: https://developer.github.com/changes/2018-04-25-github-services-deprecation
You can use the "Replacing GitHub Services" guide to help you update your services to webhooks: https://developer.github.com/v3/guides/replacing-github-services

I've also opened an issue with the provider, which I think is where the issue is:

https://github.com/terraform-providers/terraform-provider-github/issues/166

Ah interesting, thanks for reporting. Keep me updated so we can see how to work around this.

Done a little digging, it looks as though we need to migrate to using the plain 'web' configuration.

https://developer.github.com/v3/repos/hooks/#parameters

name now only accepts web, and they're planning on depreciating name altogether.

I think, we can work around it by changing the name to web, and adding in configuration that will work with SNS ... Though not 100% sure on how to do that bit yet ...

https://www.terraform.io/docs/providers/github/r/repository_webhook.html

Found this which describes how to integrate AWS with GitHub webhooks:

https://aws-quickstart.s3.amazonaws.com/quickstart-git2s3/doc/git-to-amazon-s3-using-webhooks.pdf

Basically replace SNS with a HTTPS endpoint I think

Thanks for researching this, do you want to go ahead on this?

Yup sure 👍

For the first PR, rather than editing the lambda function, I'm looking to set up the HTTPS endpoint to pretty much replicate SNS. eg. The JSON body of the request that is sent to the lambda function will be the same format as what SNS sends.

Then if we need/want to we can refactor to streamline things.

I say this because my TypeScript skills are pretty much non existent Lol

No worries, we can work on this together. I will take the lead on the Lambda integration and help getting this into shape!

Okay, well AWS now have all the functionality of the lambda tasks as configurable options, and also provides a build status badge.

Terraform now also has resources for them.

Rather than reinventing the wheel, we can just use them?

PR: #14

Resolved by #14