Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This pull request includes several changes to the `change-insight/lib/github/common.go` file to enhance security and improve error handling. The most important changes include the addition of environment variable support for GitHub tokens and improved error handling for API calls. Enhancements to security: * [`change-insight/lib/github/common.go`](diffhunk://#diff-5251738818d44ec5f50892200dc833237918634443d53426422f57f0a4ea14a9L28-R57): Replaced the hardcoded GitHub token with a function that retrieves the token from the environment variable `GITHUB_TOKEN`. Improvements to error handling: * [`change-insight/lib/github/common.go`](diffhunk://#diff-5251738818d44ec5f50892200dc833237918634443d53426422f57f0a4ea14a9L28-R57): Added error handling for unexpected status codes in the `apiCall` function, logging the status code and returning an error if it is not `http.StatusOK`. Currently, the sub app that changed in this PR is planed to be deprecated.
- Loading branch information