- Fix error if found an issue while using `gh pr lock/unlock` or vice versa
- Added additional types
- Used githubv4 types
- Added "relock" state
- If the conversation is already locked you have two choices: try to
lock it again or do nothing. Do nothing is easy. But, if you
want to change the lock reason, you need to first unlock the
conversation and then lock it again.
- Added survey to confirm if you want to relock
- Added formatted print statements
- Changed function to method
- Moved additional common options to method
- Remove redundant documentation
- Cobra sets documentation in the Command struct.
As originally designed in the issue discussion, a single function
`NewCmdLock()` with a parameter to lock or unlock was proposed.
However, after playing around with a couple different designs, it seems
best to create two separate public functions and one private function to
do the common work.
Using two public functions seems to make sense because the api for
locking is different from the api for unlocking. Therefore, the
documentation for both are different and keeping them in separate
functions would make it easier to maintain the documentation.
Since all of the port operations require the codespace to be running, we
need to disallow these operations when there's a pending op since we
can't start the codespace in this state.
Since the API already disallows this, this is basically cleaning up the
error messages that the user sees in this state
Old error message:
```
$ gh cs ports forward 80:80
? Choose codespace: redacted
Starting codespace ⣻error connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
```
New error message:
```
$ gh cs ports forward 80:80
? Choose codespace: redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
The initial intention for this change was to disallow users to open a
codespace in VS Code if the codespace has a pending operation. This also
adds a side-benefit of presenting the user an error before waiting for
VS Code to open if they provide an invalid codespace to open.
Since the API already disallows this, this pretty much just cleans up
the error reporting to the user.
Example of old error:
```
$ gh cs logs -c cwndrws-redacted
Starting codespace ⣽connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
exit status 1
```
Example of new error:
```
$ gh cs logs -c cwndrws-redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
Since the API already disallows this, this makes the error cleaner and
more explicit when a user is trying to start/ssh into a codespace that
has a pending operation.
Example of the old error message:
```
$ gh cs ssh -c cwndrws-redacted
Starting codespace ⣽error connecting to codespace: error starting codespace: HTTP 422: your codespace has an operation pending: updating to a sku with a different amount of storage; please wait until this operation is complete (https://api.github.com/user/codespaces/cwndrws-redacted/start)
exit status 1
```
Example of the new error message:
```
$ gh cs ssh -c cwndrws-redacted
codespace is disabled while it has a pending operation: Changing machine types...
exit status 1
```
* Support setting Dependabot secrets
* lint: Remove unnecessary assignment
* Use `StringEnumFlag` helper for Application input
* Add Dependabot to command description
* Move repository name mapping after input validation
* Error when multiple secret entities are set
* Return an error for invalid apps
* Use `assert` instead of `require`
* after merge, switch to base branch if available
* Add ability to checkout new branch
* Style cleanup
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>