-
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.
Merge pull request #18 from mdb/reorg
code reorganization
- Loading branch information
Showing
12 changed files
with
135 additions
and
140 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
SOURCE=./... | ||
GOFMT_FILES?=$$(find . -type f -name '*.go') | ||
VERSION?=0.0.2 | ||
VERSION?=0.0.3 | ||
|
||
default: build | ||
|
||
|
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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package cmd | ||
package dispatch | ||
|
||
var ( | ||
getWorkflowsResponse string = `{ | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package cmd | ||
package dispatch | ||
|
||
import ( | ||
"fmt" | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package cmd | ||
package dispatch | ||
|
||
import ( | ||
"bytes" | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package cmd | ||
package dispatch | ||
|
||
import ( | ||
"fmt" | ||
|