GitHub Bridge SNS Publisher
This project serves as a bridge between incoming GitHub webhooks and AWS SNS. It listens for incoming requests,
validates them based on the HMAC signature, and then publishes the payload to the appropriate SNS topic based on the
GitHub event type.
Configuration
Environment Variables
Ensure these environment variables are correctly set up for the application's smooth operation:
Name |
Description |
TOPIC_PREFIX |
Specifies the prefix for the SNS topics. |
HMAC_SECRET |
The secret key utilized for validating the HMAC signature of incoming GitHub webhooks. |
Validation and Error Handling
Always ensure that your configuration is correct. Two primary custom errors will indicate configuration issues:
ErrHmacSecretNotSet: Indicates the HmacSecret field isn't populated.
ErrTopicPrefixNotSet: Signifies that the TopicPrefix field is not populated.
If you encounter these errors, review your environment variables or configuration setup.
Development
Running Tests
To run the tests, run the following command:
go test ./...
Building the Application
To build the application, run the following command:
go build -o github-bridge-sns-publisher
Contributing
Open up a pull request with your changes. Ensure that you've added tests for your changes and that all tests pass.
Or open up an issue if you've found a bug or have a feature request.