semaphoreci / cli

Semaphore 2.0 Command Line Interface
Apache License 2.0
26 stars 13 forks source link

feat: add integration-type argument on sem init #203

Closed lucaspin closed 1 year ago

lucaspin commented 1 year ago

Adds a new --integration-type parameter to the sem init command. The possible values are github_token (default) and github_app. The project API already accepts this parameter, so no changes were required in the API.

lucaspin commented 1 year ago

@radwo sounds good to me. I'll change that.

lucaspin commented 1 year ago

@radwo I think it's a good idea to keep the allowed values for --github-integration in sync with the expected API values, so having github_token and github_app as the possible values seems like the best idea. I added a note in the help part of the command to indicate that github_token refers to OAuth token:

Initialize a project

Usage:
  sem init [flags]

Flags:
      --github-integration string   github integration for the project. Possible values are: "github_token" (OAuth token), "github_app" (default "github_token")
  -h, --help                        help for init
      --project-name string         explicitly set the project name, if not set it is extracted from the repo-url
      --repo-url string             explicitly set the repository url, if not set it is extracted from local git repository

What do you think?