Disable authentication check, but keep runnable
In this branch, we originally avoided the authentication check by getting rid of the run method attached to the command. Instead of that, this commit makes the `gh actions` command runnable again, but the authentication is disabled with `cmdutil.DisableAuthCheck`; this mirrors what's done for `gh version`. `gh actions` and `gh actions [-h | --help]` all work while being logged out. In addition, this commit restores some original behavior. Before this commit, the help footer (usage, inherited flags, etc.) is appended whether you use `gh actions` or `gh actions --help`. This commit restores the original behavior where `gh actions` prints just the text for the actions explanation, but `gh actions --help` appends the help footer.
This commit is contained in:
parent
1c103e20ac
commit
b0f58d0cf0
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package actions
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/MakeNowJust/heredoc"
|
||||
"github.com/cli/cli/pkg/cmdutil"
|
||||
"github.com/cli/cli/pkg/iostreams"
|
||||
|
|
@ -14,11 +16,16 @@ func NewCmdActions(f *cmdutil.Factory) *cobra.Command {
|
|||
Use: "actions",
|
||||
Short: "Learn about working with GitHub actions",
|
||||
Long: actionsExplainer(cs),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Fprintln(f.IOStreams.Out, actionsExplainer(cs))
|
||||
},
|
||||
Annotations: map[string]string{
|
||||
"IsActions": "true",
|
||||
},
|
||||
}
|
||||
|
||||
cmdutil.DisableAuthCheck(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue