feat: Add Credentials Revoke API by cointem · Pull Request #3847 · google/go-github

Fixes: #3846.

This pull request introduces a new service for managing credentials in the GitHub API client, specifically adding support for revoking credentials via the API. The changes include a new service implementation, comprehensive unit tests, and integration of the service into the main client.

New Credentials Service Integration:

  • Added the CredentialsService to the client, allowing users to revoke a list of credentials (tokens) through the new Revoke method in github/credentials.go.
  • Registered CredentialsService in the Client struct and initialized it in the client setup, ensuring it is available for use. [1] [2]

Testing Improvements:

  • Added a new test TestCredentialsService_Revoke in github/credentials_test.go to verify correct request formation, response handling, and error cases for credential revocation.