-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
39 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/MakeNowJust/heredoc" | ||
"github.com/mdb/gh-dispatch/dispatch" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// version's value is passed in at build time. | ||
var version string | ||
|
||
func main() { | ||
rootCmd := &cobra.Command{ | ||
Use: "gh dispatch", | ||
Short: "Send a GitHub dispatch event and watch the resulting GitHub Actions run", | ||
Long: heredoc.Doc(` | ||
Send a workflow_dispatch or repository_dispatch event and watch the resulting | ||
GitHub Actions run. | ||
`), | ||
SilenceUsage: true, | ||
Version: version, | ||
} | ||
|
||
// TODO: how to make this required? | ||
rootCmd.PersistentFlags().StringP("repo", "R", "", "The targeted repository's full name (in 'owner/repo' format)") | ||
|
||
repositoryCmd := dispatch.NewCmdRepository() | ||
rootCmd.AddCommand(repositoryCmd) | ||
|
||
workflowCmd := dispatch.NewCmdWorkflow() | ||
rootCmd.AddCommand(workflowCmd) | ||
|
||
if err := rootCmd.Execute(); err != nil { | ||
os.Exit(1) | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.