Additionally, this commit adds acceptance testing for `gh auth login` and
`gh auth logout`.
The --token flag was necessary for adding testing for `gh auth login`
because the current implementation with `--with-token` appears to be
broken. It hangs, waiting for user input, but user input doesn't exit it.
Additionally, it appears that `--with-token` is intended to allow for TTY
input of an auth token, but it isn't implemented.
`--with-token` does work when used with the redirect operator `<` when the
token is saved in a file. However, due to limitations of testscripts, I
could not use a file for saving the token in a repeatable manner. Thus,
implementing the `--token` flag seemed like a quick solution to validate
that the direction I was going during testing was valid.
Whether the flag stays or not is up for discussion, and I'd love to get
input on that from the team.
This commit refactors a bit of the variable testscripts given the changes in the secret testscripts efforts, removing potentially unnecessary assertions and making these look more similar to other testscripts.
This is a bit of a refactor based on the work done in `gh workflow` as a better approach to verify secrets created are what we expect.
Changes made:
1. Removed `env2lower` as it wasn't being used in testscripts
2. Added `replace` custom command to deal with testing organization workflow secrets
3. Refactored secret testscripts to create and run workflow that tests the value of the secret provided
4. Minor reordering of test `acceptance` test functions as appending to the end is confusing and adds conflicts
5. Removed stdout TTY assertions
This commit refactors 2 new custom commands to work more like the native env command, allowing for multiple environment variables to be set.
Additionally, the documentation on acceptance tests have been expanded to list out custom commands.
These are initial testscripts for confidence around core `gh secret` subcommands around 1) repository, 2) repository environment, 3) organization secrets.
Each testscript exercises the 3 core subcommands of `gh secret`: 1) setting, 2) listing, and 3) deleting each type of secret.
Note should be made that repository environments do not exist for free accounts such as `gh-acceptance-testing`.