Support use of PRIVATE-TOKEN to create releases using the CLI

Release Notes

In this milestone, we added the ability to use the release-cli with a PRIVATE-TOKEN as defined in Create a release API documentation. This enables overriding the user that creates a release to support automation by allowing connection of a project level PRIVATE-TOKEN or using a bot user account's PRIVATE-TOKEN.

Further details

The following discussion from !5 (merged) should be addressed:

Support using the release-cli outside of the GitLab CI environment

In #9 (closed) we decided that the release-cli will support creating releases using the JOB-TOKEN read from CI_JOB_TOKEN (see CI Environment Variables). This means that the CLI can only be used inside GitLab's CI environment.

We should allow users to use the release-cli with a PRIVATE-TOKEN as defined in Create a release API documentation.

Options

Some options are

  1. separate the -token option into -job-token and -private-token (would break compatibility if !6 (merged) gets merged first) or
  2. [-] add a boolean option like -ci, when set then let the code decide if we set PRIVATE-TOKEN or JOB-TOKEN. So if -ci=true default token value to CI_JOB_TOKEN read from the env vars

Implementation

Edited by Jaime Martinez