Add a client method to gitlab-releases that takes a token
🔥 Problem
Authentication for the gitlab-releases
gem uses an environment variable, RELEASES_GITLAB_READ_TOKEN
. This means that anyone using the gem has to set this variable. If we ever change the variable, it is a breaking change for users.
🚒 Solution
Introduce a Client
class that takes a token as a param, for example:
client = Releases.client(
private_token: ENV.fetch('PRIVATE_TOKEN_PAT', nil),
)
client.previous_version
This allows users to set any local variables they are using to store the token with any name they would like.
References
This issue is a followup to #19594 (comment 1527791779)
Edited by Steve Abrams