Skip to content

Commit

Permalink
feat: remove release management
Browse files Browse the repository at this point in the history
as hub already manage releases
  • Loading branch information
Sébastien HOUZÉ committed Aug 19, 2019
1 parent a361f48 commit 35a4918
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 260 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ You can manipulate following Github resources:

- deployment
- deployment_status
- release

## What it will (probably) never do

Managing resources like pull requests, issues or repositories life cycle and settings.
Managing resources like pull requests, issues or repositories life cycle and settings for example.

Some very good tools like [hub](https://github.com/github/hub) or [terraform's github provider](https://www.terraform.io/docs/providers/github/index.html) are already great at doing that.

Expand All @@ -23,10 +22,6 @@ The goal is to have a convenient, lightweight tool to use inside github [actions
Some use cases that motivated the creation of this tool were:

```shell
# Append some deploy button inside a release note
printf "%s\nDEPLOY_BUTTON_CODE" $(github release get ID | jq .body) | \
github release edit ID --body -

# Create a production deployment and corresponding status
DEPLOYMENT_ID=$(
github deployment create \
Expand Down
234 changes: 0 additions & 234 deletions cmd/release.go

This file was deleted.

6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var rootCmd = &cobra.Command{
Long: ``,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
token := os.Getenv("GITHUB_TOKEN")
if cmd.Name() != "help" && cmd.Name() != "deployment" && cmd.Name() != "deployment_status" && cmd.Name() != "release" && token == "" {
if cmd.Name() != "help" && cmd.Name() != "deployment" && cmd.Name() != "deployment_status" && token == "" {
log.Fatal("Please define GITHUB_TOKEN. See documentation to obtain one if needed: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line")
}
ctx = context.Background()
Expand All @@ -45,7 +45,7 @@ var rootCmd = &cobra.Command{
githubRepository = os.Getenv("GITHUB_REPOSITORY")
}
owner, repository = splitGithubRepository(githubRepository)
if cmd.Name() != "help" && cmd.Name() != "deployment" && cmd.Name() != "deployment_status" && cmd.Name() != "release" && owner == "" && repository == "" {
if cmd.Name() != "help" && cmd.Name() != "deployment" && cmd.Name() != "deployment_status" && owner == "" && repository == "" {
log.Fatal("Github repository is required.")
}
},
Expand Down Expand Up @@ -75,5 +75,5 @@ func splitGithubRepository(repository string) (string, string) {
func init() {
rootCmd.PersistentFlags().StringVarP(&githubRepository, "repository", "r", "", "the owner and repository name. For example, octocat/Hello-World. Environment variable GITHUB_REPOSITORY will be used as a fallback.")

rootCmd.Version = "0.1.0"
rootCmd.Version = "1.0.0"
}
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.12
require (
github.com/google/go-github/v27 v27.0.4
github.com/spf13/cobra v0.0.5
github.com/spf13/viper v1.3.2
github.com/stretchr/testify v1.3.0 // indirect
github.com/spf13/viper v1.4.0
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
)
Loading

0 comments on commit 35a4918

Please sign in to comment.