├── .github ├── CODEOWNERS ├── workflows │ ├── dependency_review.yml │ ├── schedule.yml │ ├── test.yml │ └── release.yml ├── dependabot.yml └── release.yml ├── .gitignore ├── lib ├── version.go ├── export_test.go ├── open_settings.go ├── format_test.go ├── settings_test.go ├── list.go ├── events.go ├── settings.go ├── init.go └── format.go ├── .coderabbit.yaml ├── config └── settings.yml ├── cmd ├── list.go ├── version.go ├── init.go ├── open_settings.go └── root.go ├── main.go ├── go.mod ├── statik └── statik.go ├── LICENSE.txt ├── SECURITY.md ├── .tagpr ├── .goreleaser.yaml ├── Makefile ├── go.sum ├── README.md └── CHANGELOG.md /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @masutaka 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /github-nippou 3 | -------------------------------------------------------------------------------- /lib/version.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | // Version is the github-nippou version 4 | const Version = "4.2.43" 5 | -------------------------------------------------------------------------------- /.coderabbit.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json 2 | # Complete reference: https://docs.coderabbit.ai/reference/configuration 3 | 4 | language: "en-US" 5 | -------------------------------------------------------------------------------- /lib/export_test.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | var GetUser = getUser 4 | var GetAccessToken = getAccessToken 5 | var GetGistID = getGistID 6 | var GetParallelNum = getParallelNum 7 | var GetDefaultSettingsURL = getDefaultSettingsURL 8 | -------------------------------------------------------------------------------- /config/settings.yml: -------------------------------------------------------------------------------- 1 | format: 2 | subject: '### %{subject}' 3 | line: '* [%{title}](%{url}) by @[%{user}](https://github.com/%{user}) %{status}' 4 | dictionary: 5 | status: 6 | merged: '**merged!**' 7 | closed: '**closed!**' 8 | -------------------------------------------------------------------------------- /cmd/list.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | ) 6 | 7 | var listCmd = &cobra.Command{ 8 | Use: "list", 9 | Short: RootCmd.Short, 10 | Run: RootCmd.Run, 11 | } 12 | 13 | func init() { 14 | RootCmd.AddCommand(listCmd) 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/dependency_review.yml: -------------------------------------------------------------------------------- 1 | name: Dependency Review 2 | 3 | on: [pull_request] 4 | 5 | permissions: 6 | contents: read 7 | pull-requests: write 8 | 9 | jobs: 10 | dependency_review: 11 | uses: masutaka/actions/.github/workflows/dependency_review.yml@main 12 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | //go:generate statik -src=./config -m 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | 9 | "github.com/masutaka/github-nippou/v4/cmd" 10 | ) 11 | 12 | func main() { 13 | if err := cmd.RootCmd.Execute(); err != nil { 14 | fmt.Println(err) 15 | os.Exit(1) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /cmd/version.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | 7 | "github.com/masutaka/github-nippou/v4/lib" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | var versionCmd = &cobra.Command{ 12 | Use: "version", 13 | Short: "Print version", 14 | Run: func(cmd *cobra.Command, args []string) { 15 | fmt.Printf("%s (built with %s)\n", lib.Version, runtime.Version()) 16 | }, 17 | } 18 | 19 | func init() { 20 | RootCmd.AddCommand(versionCmd) 21 | } 22 | -------------------------------------------------------------------------------- /cmd/init.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/masutaka/github-nippou/v4/lib" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | var initCmd = &cobra.Command{ 12 | Use: "init", 13 | Short: "Initialize github-nippou settings", 14 | Run: func(cmd *cobra.Command, args []string) { 15 | if err := lib.Init(); err != nil { 16 | fmt.Println(err) 17 | os.Exit(1) 18 | } 19 | }, 20 | } 21 | 22 | func init() { 23 | RootCmd.AddCommand(initCmd) 24 | } 25 | -------------------------------------------------------------------------------- /lib/open_settings.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/skratchdot/open-golang/open" 7 | ) 8 | 9 | // OpenSettings opens settings url with web browser 10 | func OpenSettings() error { 11 | var settings Settings 12 | 13 | accessToken, err := getAccessToken() 14 | if err != nil { 15 | return err 16 | } 17 | 18 | if err := settings.Init(getGistID(), accessToken); err != nil { 19 | return nil 20 | } 21 | 22 | fmt.Printf("Open %s\n", settings.URL) 23 | return open.Run(settings.URL) 24 | } 25 | -------------------------------------------------------------------------------- /cmd/open_settings.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/masutaka/github-nippou/v4/lib" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | var openSettingsCmd = &cobra.Command{ 12 | Use: "open-settings", 13 | Short: "Open settings url with web browser", 14 | Run: func(cmd *cobra.Command, args []string) { 15 | if err := lib.OpenSettings(); err != nil { 16 | fmt.Println(err) 17 | os.Exit(1) 18 | } 19 | }, 20 | } 21 | 22 | func init() { 23 | RootCmd.AddCommand(openSettingsCmd) 24 | } 25 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "monthly" 8 | time: "19:00" 9 | timezone: "Asia/Tokyo" 10 | cooldown: 11 | default-days: 7 12 | - package-ecosystem: "gomod" 13 | directory: "/" 14 | schedule: 15 | interval: "monthly" 16 | time: "19:00" 17 | timezone: "Asia/Tokyo" 18 | cooldown: 19 | default-days: 7 20 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | exclude: 3 | labels: 4 | - tagpr 5 | categories: 6 | - title: "Breaking Changes :hammer_and_wrench:" 7 | labels: 8 | - breaking-change 9 | - title: "New Features :tada:" 10 | labels: 11 | - enhancement 12 | - title: "Fix bug :bug:" 13 | labels: 14 | - bug 15 | - title: "Maintenance :technologist:" 16 | labels: 17 | - dependencies 18 | - maintenance 19 | - title: "Documentation :memo:" 20 | labels: 21 | - documentation 22 | - title: "Other Changes" 23 | labels: 24 | - "*" 25 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/masutaka/github-nippou/v4 2 | 3 | go 1.24.0 4 | 5 | toolchain go1.24.3 6 | 7 | require ( 8 | github.com/google/go-github/v80 v80.0.0 9 | github.com/rakyll/statik v0.1.7 10 | github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e 11 | github.com/spf13/cobra v1.10.1 12 | golang.org/x/oauth2 v0.33.0 13 | gopkg.in/yaml.v3 v3.0.1 14 | ) 15 | 16 | require ( 17 | github.com/google/go-querystring v1.1.0 // indirect 18 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 19 | github.com/kr/pretty v0.2.0 // indirect 20 | github.com/spf13/pflag v1.0.9 // indirect 21 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect 22 | ) 23 | -------------------------------------------------------------------------------- /.github/workflows/schedule.yml: -------------------------------------------------------------------------------- 1 | name: Schedule 2 | 3 | on: 4 | schedule: 5 | - cron: "00 10 * * 5" # every friday 19:00 JST 6 | 7 | jobs: 8 | codeql: 9 | strategy: 10 | matrix: 11 | language: [actions, go] 12 | permissions: 13 | actions: read 14 | checks: read 15 | contents: read 16 | security-events: write 17 | uses: masutaka/actions/.github/workflows/codeql_core.yml@main 18 | with: 19 | language: ${{ matrix.language }} 20 | pushover: 21 | name: pushover if failure 22 | if: github.ref_name == github.event.repository.default_branch && failure() 23 | needs: codeql 24 | uses: masutaka/actions/.github/workflows/pushover.yml@main 25 | permissions: 26 | contents: read 27 | secrets: 28 | PUSHOVER_API_KEY: ${{ secrets.PUSHOVER_API_KEY }} 29 | PUSHOVER_USER_KEY: ${{ secrets.PUSHOVER_USER_KEY }} 30 | -------------------------------------------------------------------------------- /statik/statik.go: -------------------------------------------------------------------------------- 1 | // Code generated by statik. DO NOT EDIT. 2 | 3 | // Package statik contains static assets. 4 | package statik 5 | 6 | import ( 7 | "github.com/rakyll/statik/fs" 8 | ) 9 | 10 | func init() { 11 | data := "PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00 \x00settings.ymlUT\x05\x00\x01\x80Cm8,\x8d1\xae\x84 \x14E{Wq\x7f\x0cA)\xbe=\xd5\xec\xc3X(2\xca\x04e\x02\x8f\xc2\x10\xf6>\x11\xe9\xce{'\xb9\xe7\xed\xfc1\x93l\x80\x10\x97\x8fV$\xc1\xdb\xb6\x05K\xf5\xce\xbc\x01\xac9\xb5\x04\x17\x18Y\"CV\xe7\xa9c)z\x9b{,\x17^#K1h\x9f\xa7n'\xfa\x069\x0c\x9b\xa1=.\xff\xca\x1dCu\xfd\xbdI3\xc5\x90y\xb3\x1aE\xc6\x9d\xb3\xbfJ\xba\xbco\x02\x0e\xed7\xbd\xde1\xf1\xe0\x9f\x10\xbc\x18e]\xa8\xe6\xc1b~\x01\x00\x00\xff\xffPK\x07\x08\xc4r\x85G\x8f\x00\x00\x00\xc1\x00\x00\x00PK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x00\x00!(\xc4r\x85G\x8f\x00\x00\x00\xc1\x00\x00\x00\x0c\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x00\x00\x00\x00settings.ymlUT\x05\x00\x01\x80Cm8PK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x00C\x00\x00\x00\xd2\x00\x00\x00\x00\x00" 12 | fs.Register(data) 13 | } 14 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Takashi Masuda 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "time" 7 | 8 | "github.com/masutaka/github-nippou/v4/lib" 9 | "github.com/spf13/cobra" 10 | ) 11 | 12 | var sinceDate string 13 | var untilDate string 14 | var debug bool 15 | 16 | // RootCmd defines a root command 17 | var RootCmd = &cobra.Command{ 18 | Use: "github-nippou", 19 | Short: "Print today's your GitHub activity for issues and pull requests", 20 | Run: func(cmd *cobra.Command, args []string) { 21 | list, err := lib.NewListFromCLI(sinceDate, untilDate, debug) 22 | if err != nil { 23 | fmt.Println(err) 24 | os.Exit(1) 25 | } 26 | 27 | lines, err := list.Collect() 28 | if err != nil { 29 | fmt.Println(err) 30 | os.Exit(1) 31 | } 32 | 33 | fmt.Println(lines) 34 | }, 35 | } 36 | 37 | func init() { 38 | nowDate := time.Now().Format("20060102") 39 | sinceDate = nowDate 40 | untilDate = nowDate 41 | 42 | RootCmd.PersistentFlags().StringVarP(&sinceDate, "since-date", "s", sinceDate, "Retrieves GitHub user_events since the date") 43 | RootCmd.PersistentFlags().StringVarP(&untilDate, "until-date", "u", untilDate, "Retrieves GitHub user_events until the date") 44 | RootCmd.PersistentFlags().BoolVarP(&debug, "debug", "d", false, "Debug mode") 45 | } 46 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | We only provide security updates for the latest version of the project. Please make sure you are using the latest version before reporting any issues. 6 | 7 | | Version | Supported | 8 | | ------- | ------------------ | 9 | | Latest | :white_check_mark: | 10 | | Older | :x: | 11 | 12 | ## Reporting a Vulnerability 13 | 14 | If you discover a security vulnerability, please follow the steps below: 15 | 16 | 1. Go to the repository's [Security Advisories](https://github.com/masutaka/github-nippou/security/advisories) page. 17 | 2. Click on **"New draft security advisory"**. 18 | 3. Provide as much detail as possible about the vulnerability, including the steps to reproduce the issue. 19 | 20 | Please do not open a public issue for the vulnerability. All vulnerabilities reported through Security Advisories will be reviewed and addressed as soon as possible. 21 | 22 | ## Preferred Languages 23 | 24 | We prefer all security reports to be in **Japanese** or **English**. 25 | 26 | ## Response Time 27 | 28 | You can expect a response within a few days. 29 | 30 | ## Security Updates 31 | 32 | Once a security fix is available, we will release a new version and notify users via the repository's release notes. 33 | 34 | ## Contact 35 | 36 | If you have any questions or need further assistance, please contact [masutaka.net@gmail.com](mailto:masutaka.net@gmail.com). 37 | -------------------------------------------------------------------------------- /lib/format_test.go: -------------------------------------------------------------------------------- 1 | package lib_test 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | "github.com/google/go-github/v80/github" 8 | "github.com/masutaka/github-nippou/v4/lib" 9 | ) 10 | 11 | func TestFormatAll(t *testing.T) { 12 | issue := github.Issue{ 13 | State: github.String("closed"), 14 | Title: github.String("イベントを取得できないことがある"), 15 | User: &github.User{Login: github.String("masutaka")}, 16 | HTMLURL: github.String("https://github.com/masutaka/github-nippou/issues/1"), 17 | } 18 | pr := github.PullRequest{ 19 | State: github.String("closed"), 20 | Title: github.String("Bundle Update on 2015-10-04"), 21 | User: &github.User{Login: github.String("deppbot")}, 22 | HTMLURL: github.String("https://github.com/masutaka/github-nippou/pull/31"), 23 | Merged: github.Bool(true), 24 | } 25 | lines := lib.Lines{ 26 | lib.NewLineByIssue("masutaka/github-nippou", issue), 27 | lib.NewLineByPullRequest("masutaka/github-nippou", pr), 28 | } 29 | settings := lib.Settings{} 30 | settings.Init("", "") 31 | 32 | ctx := context.Background() 33 | f := lib.NewFormat(ctx, nil, settings, false) 34 | 35 | result, err := f.All(lines) 36 | if err != nil { 37 | t.Errorf("unexpected error: %v", err) 38 | } 39 | 40 | expected := ` 41 | ### masutaka/github-nippou 42 | 43 | * [イベントを取得できないことがある](https://github.com/masutaka/github-nippou/issues/1) by @[masutaka](https://github.com/masutaka) **closed!** 44 | * [Bundle Update on 2015-10-04](https://github.com/masutaka/github-nippou/pull/31) by @[deppbot](https://github.com/deppbot) **merged!** 45 | ` 46 | 47 | if result != expected { 48 | t.Errorf("unexpected result: got %q, want %q", result, expected) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | jobs: 10 | actionlint: 11 | runs-on: ubuntu-latest 12 | timeout-minutes: 5 13 | permissions: 14 | checks: write 15 | contents: read 16 | pull-requests: write 17 | steps: 18 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 19 | - name: Run actionlint 20 | uses: reviewdog/action-actionlint@f00ad0691526c10be4021a91b2510f0a769b14d0 # v1.68.0 21 | with: 22 | fail_level: error 23 | filter_mode: nofilter 24 | level: error 25 | reporter: github-pr-review 26 | codeql: 27 | permissions: 28 | actions: read 29 | checks: read 30 | contents: read 31 | security-events: write 32 | uses: masutaka/actions/.github/workflows/codeql.yml@main 33 | test: 34 | runs-on: ubuntu-latest 35 | timeout-minutes: 5 36 | permissions: 37 | contents: read 38 | steps: 39 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 40 | - name: Setup Go environment 41 | uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 42 | with: 43 | go-version-file: "go.mod" 44 | - run: make test-all 45 | pushover: 46 | name: pushover if failure 47 | if: github.ref_name == github.event.repository.default_branch && failure() 48 | needs: [actionlint, codeql, test] 49 | uses: masutaka/actions/.github/workflows/pushover.yml@main 50 | permissions: 51 | contents: read 52 | secrets: 53 | PUSHOVER_API_KEY: ${{ secrets.PUSHOVER_API_KEY }} 54 | PUSHOVER_USER_KEY: ${{ secrets.PUSHOVER_USER_KEY }} 55 | -------------------------------------------------------------------------------- /lib/settings_test.go: -------------------------------------------------------------------------------- 1 | package lib_test 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/masutaka/github-nippou/v4/lib" 8 | ) 9 | 10 | func TestInit(t *testing.T) { 11 | t.Skip("This test is pending.") 12 | } 13 | 14 | func TestGetUser(t *testing.T) { 15 | os.Setenv("GITHUB_NIPPOU_USER", "taro") 16 | defer os.Unsetenv("GITHUB_NIPPOU_USER") 17 | 18 | actual, _ := lib.GetUser() 19 | const expected = "taro" 20 | if actual != expected { 21 | t.Errorf("expected %s but got %s", expected, actual) 22 | } 23 | } 24 | 25 | func TestGetAccessToken(t *testing.T) { 26 | os.Setenv("GITHUB_NIPPOU_ACCESS_TOKEN", "1234abcd") 27 | defer os.Unsetenv("GITHUB_NIPPOU_ACCESS_TOKEN") 28 | 29 | actual, _ := lib.GetAccessToken() 30 | const expected = "1234abcd" 31 | if actual != expected { 32 | t.Errorf("expected %s but got %s", expected, actual) 33 | } 34 | } 35 | 36 | func TestGetGistID(t *testing.T) { 37 | os.Setenv("GITHUB_NIPPOU_SETTINGS_GIST_ID", "0123456789") 38 | defer os.Unsetenv("GITHUB_NIPPOU_SETTINGS_GIST_ID") 39 | 40 | actual := lib.GetGistID() 41 | const expected = "0123456789" 42 | if actual != expected { 43 | t.Errorf("expected %s but got %s", expected, actual) 44 | } 45 | } 46 | 47 | func TestGetParallelNum(t *testing.T) { 48 | os.Setenv("GITHUB_NIPPOU_THREAD_NUM", "10") 49 | defer os.Unsetenv("GITHUB_NIPPOU_THREAD_NUM") 50 | 51 | actual, _ := lib.GetParallelNum() 52 | const expected = 10 53 | if actual != expected { 54 | t.Errorf("expected %d but got %d", expected, actual) 55 | } 56 | } 57 | 58 | func TestGetDefaultSettingsURL(t *testing.T) { 59 | actual := lib.GetDefaultSettingsURL() 60 | const expected = "https://github.com/masutaka/github-nippou/blob/v" + lib.Version + "/config/settings.yml" 61 | if actual != expected { 62 | t.Errorf("expected %s but got %s", expected, actual) 63 | } 64 | } 65 | 66 | func TestGetDefaultSettingsYml(t *testing.T) { 67 | t.Skip("This test is pending.") 68 | } 69 | -------------------------------------------------------------------------------- /.tagpr: -------------------------------------------------------------------------------- 1 | # config file for the tagpr in git config format 2 | # The tagpr generates the initial configuration, which you can rewrite to suit your environment. 3 | # CONFIGURATIONS: 4 | # tagpr.releaseBranch 5 | # Generally, it is "main." It is the branch for releases. The tagpr tracks this branch, 6 | # creates or updates a pull request as a release candidate, or tags when they are merged. 7 | # 8 | # tagpr.versionFile 9 | # Versioning file containing the semantic version needed to be updated at release. 10 | # It will be synchronized with the "git tag". 11 | # Often this is a meta-information file such as gemspec, setup.cfg, package.json, etc. 12 | # Sometimes the source code file, such as version.go or Bar.pm, is used. 13 | # If you do not want to use versioning files but only git tags, specify the "-" string here. 14 | # You can specify multiple version files by comma separated strings. 15 | # 16 | # tagpr.vPrefix 17 | # Flag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true) 18 | # This is only a tagging convention, not how it is described in the version file. 19 | # 20 | # tagpr.changelog (Optional) 21 | # Flag whether or not changelog is added or changed during the release. 22 | # 23 | # tagpr.command (Optional) 24 | # Command to change files just before release. 25 | # 26 | # tagpr.template (Optional) 27 | # Pull request template in go template format 28 | # 29 | # tagpr.release (Optional) 30 | # GitHub Release creation behavior after tagging [true, draft, false] 31 | # If this value is not set, the release is to be created. 32 | # 33 | # tagpr.majorLabels (Optional) 34 | # Label of major update targets. Default is [major] 35 | # 36 | # tagpr.minorLabels (Optional) 37 | # Label of minor update targets. Default is [minor] 38 | # 39 | [tagpr] 40 | vPrefix = true 41 | releaseBranch = main 42 | versionFile = lib/version.go 43 | release = draft 44 | -------------------------------------------------------------------------------- /.goreleaser.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | before: 4 | hooks: 5 | - go mod download 6 | - go mod tidy 7 | 8 | builds: 9 | - id: github-nippou-darwin 10 | env: 11 | - CGO_ENABLED=0 12 | goos: 13 | - darwin 14 | goarch: 15 | - amd64 16 | - arm64 17 | main: ./main.go 18 | - id: github-nippou-linux 19 | env: 20 | - CGO_ENABLED=0 21 | goos: 22 | - linux 23 | goarch: 24 | - amd64 25 | - arm64 26 | main: ./main.go 27 | - id: github-nippou-windows 28 | env: 29 | - CGO_ENABLED=0 30 | goos: 31 | - windows 32 | goarch: 33 | - amd64 34 | main: ./main.go 35 | 36 | archives: 37 | - formats: [ "zip" ] 38 | name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' 39 | files: 40 | - CHANGELOG.md 41 | - LICENSE.txt 42 | - README.md 43 | 44 | checksum: 45 | name_template: '{{ .ProjectName }}_v{{ .Version }}_checksums.txt' 46 | 47 | release: 48 | use_existing_draft: true 49 | 50 | snapshot: 51 | version_template: "{{ .Version }}-next" 52 | 53 | changelog: 54 | sort: asc 55 | filters: 56 | exclude: 57 | - "^docs:" 58 | - "^test:" 59 | 60 | brews: 61 | - name: github-nippou 62 | repository: 63 | owner: masutaka 64 | name: homebrew-tap 65 | token: "{{ .Env.TAP_GITHUB_TOKEN }}" 66 | commit_author: 67 | name: "github-actions[bot]" 68 | email: "github-actions[bot]@users.noreply.github.com" 69 | homepage: "https://github.com/masutaka/github-nippou" 70 | description: "Print today's your GitHub activity for issues and pull requests" 71 | license: "MIT" 72 | install: | 73 | bin.install 'github-nippou' 74 | 75 | # Install bash completion 76 | output = Utils.safe_popen_read("#{bin}/github-nippou", 'completion', 'bash') 77 | (bash_completion/'github-nippou').write output 78 | 79 | # Install fish completion 80 | output = Utils.safe_popen_read("#{bin}/github-nippou", 'completion', 'fish') 81 | (fish_completion/'github-nippou.fish').write output 82 | 83 | # Install zsh completion 84 | output = Utils.safe_popen_read("#{bin}/github-nippou", 'completion', 'zsh') 85 | (zsh_completion/'_github-nippou').write output 86 | test: | 87 | system 'github-nippou', 'version' 88 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | NAME := github-nippou 2 | SRCS := go.mod go.sum $(shell find . -type f ! -path ./statik/statik.go -name '*.go' ! -name '*_test.go') 3 | CONFIGS := $(wildcard config/*) 4 | VERSION := v$(shell grep 'const Version ' lib/version.go | sed -E 's/.*"(.+)"$$/\1/') 5 | PACKAGES := $(shell go list ./...) 6 | 7 | ifeq (Windows_NT, $(OS)) 8 | NAME := $(NAME).exe 9 | endif 10 | 11 | all: $(NAME) 12 | 13 | # Install dependencies for development 14 | .PHONY: deps 15 | deps: statik 16 | go mod download 17 | 18 | .PHONY: statik 19 | statik: 20 | ifeq ($(shell command -v statik 2> /dev/null),) 21 | go install github.com/rakyll/statik@latest 22 | endif 23 | 24 | # Build binary 25 | $(NAME): statik/statik.go $(SRCS) 26 | go build -o $(NAME) 27 | 28 | statik/statik.go: $(CONFIGS) 29 | go generate 30 | 31 | # Install binary to $GOPATH/bin 32 | .PHONY: install 33 | install: 34 | go install 35 | 36 | # Clean binary 37 | .PHONY: clean 38 | clean: 39 | $(RM) $(NAME) 40 | 41 | # Test for development 42 | .PHONY: test 43 | test: statik/statik.go 44 | go test -v $(PACKAGES) 45 | 46 | # Test for CI 47 | .PHONY: test-all 48 | test-all: deps-test-all vet lint test 49 | 50 | .PHONY: deps-test-all 51 | deps-test-all: statik golint statik/statik.go 52 | go mod download 53 | 54 | .PHONY: golint 55 | golint: 56 | ifeq ($(shell command -v golint 2> /dev/null),) 57 | go install golang.org/x/lint/golint@latest 58 | endif 59 | 60 | .PHONY: vet 61 | vet: 62 | go vet $(PACKAGES) 63 | 64 | .PHONY: lint 65 | lint: 66 | echo $(PACKAGES) | xargs -n1 golint -set_exit_status 67 | 68 | # Bump go version 69 | .PHONY: bump_go_version 70 | bump_go_version: 71 | @printf "go version (x.y.z)? "; read version; \ 72 | go mod edit -go="$$version" 73 | go mod tidy 74 | 75 | # Generate binary archives for release check on local machine 76 | .PHONY: dist 77 | dist: deps-dist 78 | goreleaser release --snapshot --clean 79 | 80 | .PHONY: deps-dist 81 | deps-dist: goreleaser 82 | 83 | # Release binary archives to GitHub 84 | .PHONY: release 85 | release: deps-release release-check 86 | goreleaser --clean 87 | 88 | .PHONY: deps-release 89 | deps-release: goreleaser 90 | 91 | .PHONY: release-check 92 | release-check: 93 | goreleaser check 94 | 95 | .PHONY: goreleaser 96 | goreleaser: 97 | ifeq ($(shell command -v goreleaser 2> /dev/null),) 98 | go install github.com/goreleaser/goreleaser@latest 99 | endif 100 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= 2 | github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 3 | github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= 4 | github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= 5 | github.com/google/go-github/v80 v80.0.0 h1:BTyk3QOHekrk5VF+jIGz1TNEsmeoQG9K/UWaaP+EWQs= 6 | github.com/google/go-github/v80 v80.0.0/go.mod h1:pRo4AIMdHW83HNMGfNysgSAv0vmu+/pkY8nZO9FT9Yo= 7 | github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= 8 | github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= 9 | github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 10 | github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 11 | github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= 12 | github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 13 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 14 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 15 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 16 | github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= 17 | github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= 18 | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 19 | github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e h1:VAzdS5Nw68fbf5RZ8RDVlUvPXNU6Z3jtPCK/qvm4FoQ= 20 | github.com/skratchdot/open-golang v0.0.0-20190402232053-79abb63cd66e/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= 21 | github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= 22 | github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= 23 | github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= 24 | github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 25 | golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= 26 | golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= 27 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 28 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 29 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= 30 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 31 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 32 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 33 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | workflow_run: 5 | workflows: 6 | - Test 7 | types: 8 | - completed 9 | branches: 10 | - main 11 | 12 | concurrency: 13 | group: ${{ github.workflow }} 14 | 15 | jobs: 16 | tagpr: 17 | # (1) Create a release pull request. 18 | # e.g. https://github.com/masutaka/github-nippou/pull/132 19 | # (2) If the pull request exists, update it. 20 | # (3) If the pull request is merged, create a new git tag. 21 | if: ${{ github.event.workflow_run.conclusion == 'success' }} 22 | runs-on: ubuntu-latest 23 | timeout-minutes: 5 24 | permissions: 25 | contents: read 26 | steps: 27 | - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 28 | id: app-token 29 | with: 30 | app-id: ${{ vars.CI_APP_ID }} 31 | private-key: ${{ secrets.CI_APP_PRIVATE_KEY }} 32 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 33 | with: 34 | token: ${{ steps.app-token.outputs.token }} 35 | - id: run-tagpr 36 | uses: Songmu/tagpr@7191605433b03e11b313dbbc0efb80185170de4b # v1.9.0 37 | env: 38 | GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} 39 | outputs: 40 | tagpr-tag: ${{ steps.run-tagpr.outputs.tag }} 41 | release: 42 | # When (3) above, the if condition is satisfied. 43 | # The github-nippou binaries are built and uploaded to GitHub release. 44 | if: needs.tagpr.outputs.tagpr-tag != '' 45 | needs: tagpr 46 | runs-on: ubuntu-latest 47 | timeout-minutes: 5 48 | permissions: 49 | contents: write 50 | steps: 51 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 52 | with: 53 | fetch-tags: true 54 | - name: Setup Go environment 55 | uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 56 | with: 57 | go-version-file: "go.mod" 58 | - name: Setup GoReleaser 59 | uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 60 | with: 61 | install-only: true 62 | - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 63 | id: app-token 64 | with: 65 | app-id: ${{ vars.RELEASE_APP_ID }} 66 | private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} 67 | owner: "masutaka" 68 | repositories: "homebrew-tap" 69 | - name: Release 70 | run: make release 71 | env: 72 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 73 | TAP_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} 74 | pushover: 75 | name: pushover if failure 76 | if: failure() 77 | needs: [release] 78 | uses: masutaka/actions/.github/workflows/pushover.yml@main 79 | permissions: 80 | contents: read 81 | secrets: 82 | PUSHOVER_API_KEY: ${{ secrets.PUSHOVER_API_KEY }} 83 | PUSHOVER_USER_KEY: ${{ secrets.PUSHOVER_USER_KEY }} 84 | -------------------------------------------------------------------------------- /lib/list.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | import ( 4 | "context" 5 | "sync" 6 | "time" 7 | 8 | "github.com/google/go-github/v80/github" 9 | ) 10 | 11 | // List is a struct for collecting GitHub activities. 12 | type List struct { 13 | sinceDate string 14 | untilDate string 15 | user string 16 | accessToken string 17 | settingsGistID string 18 | debug bool 19 | } 20 | 21 | // NewList returns a new List. 22 | func NewList(sinceDate, untilDate, user, accessToken, settingsGistID string, debug bool) *List { 23 | return &List{ 24 | sinceDate: sinceDate, 25 | untilDate: untilDate, 26 | user: user, 27 | accessToken: accessToken, 28 | settingsGistID: settingsGistID, 29 | debug: debug, 30 | } 31 | } 32 | 33 | // NewListFromCLI returns a new List from environment variables or git config. 34 | func NewListFromCLI(sinceDate, untilDate string, debug bool) (*List, error) { 35 | user, err := getUser() 36 | if err != nil { 37 | return nil, err 38 | } 39 | accessToken, err := getAccessToken() 40 | if err != nil { 41 | return nil, err 42 | } 43 | settingsGistID := getGistID() 44 | 45 | return &List{ 46 | sinceDate: sinceDate, 47 | untilDate: untilDate, 48 | user: user, 49 | accessToken: accessToken, 50 | settingsGistID: settingsGistID, 51 | debug: debug, 52 | }, nil 53 | } 54 | 55 | // Collect collects GitHub activities. 56 | func (l *List) Collect() (string, error) { 57 | sinceTime, err := getSinceTime(l.sinceDate) 58 | if err != nil { 59 | return "", err 60 | } 61 | 62 | untilTime, err := getUntilTime(l.untilDate) 63 | if err != nil { 64 | return "", err 65 | } 66 | 67 | ctx := context.Background() 68 | client := getClient(ctx, l.accessToken) 69 | 70 | events, err := NewEvents(ctx, client, l.user, sinceTime, untilTime, l.debug).Collect() 71 | if err != nil { 72 | return "", err 73 | } 74 | var settings Settings 75 | if err = settings.Init(l.settingsGistID, l.accessToken); err != nil { 76 | return "", err 77 | } 78 | format := NewFormat(ctx, client, settings, l.debug) 79 | 80 | parallelNum, err := getParallelNum() 81 | if err != nil { 82 | return "", err 83 | } 84 | 85 | sem := make(chan int, parallelNum) 86 | var lines Lines 87 | var wg sync.WaitGroup 88 | var mu sync.Mutex 89 | 90 | for i, event := range events { 91 | wg.Add(1) 92 | go func(event *github.Event, i int) { 93 | defer wg.Done() 94 | sem <- 1 95 | line := format.Line(event, i) 96 | <-sem 97 | 98 | mu.Lock() 99 | defer mu.Unlock() 100 | lines = append(lines, line) 101 | }(event, i) 102 | } 103 | wg.Wait() 104 | 105 | allLines, err := format.All(lines) 106 | if err != nil { 107 | return "", err 108 | } 109 | 110 | return allLines, nil 111 | } 112 | 113 | func getSinceTime(sinceDate string) (time.Time, error) { 114 | return time.Parse("20060102 15:04:05 MST", sinceDate+" 00:00:00 "+getZoneName()) 115 | } 116 | 117 | func getUntilTime(untilDate string) (time.Time, error) { 118 | result, err := time.Parse("20060102 15:04:05 MST", untilDate+" 00:00:00 "+getZoneName()) 119 | if err != nil { 120 | return result, err 121 | } 122 | 123 | return result.AddDate(0, 0, 1).Add(-time.Nanosecond), nil 124 | } 125 | 126 | func getZoneName() string { 127 | zone, _ := time.Now().Zone() 128 | return zone 129 | } 130 | -------------------------------------------------------------------------------- /lib/events.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "log" 7 | "time" 8 | 9 | "github.com/google/go-github/v80/github" 10 | ) 11 | 12 | // Events represents a structure for fetching user-related events from the GitHub API. 13 | // It holds the necessary parameters to filter and retrieve specific event data for a user. 14 | type Events struct { 15 | ctx context.Context 16 | client *github.Client 17 | user string 18 | sinceTime time.Time 19 | untilTime time.Time 20 | debug bool 21 | } 22 | 23 | // NewEvents is an initializer 24 | func NewEvents(ctx context.Context, client *github.Client, user string, sinceTime, untilTime time.Time, debug bool) *Events { 25 | return &Events{ctx: ctx, client: client, user: user, sinceTime: sinceTime, untilTime: untilTime, debug: debug} 26 | } 27 | 28 | // Collect retrieve GitHub `e.user` events from `e.sinceTime` to `e.untilTime` 29 | func (e *Events) Collect() ([]*github.Event, error) { 30 | return e.uniq(e.filter(e.retrieve())) 31 | } 32 | 33 | func (e *Events) retrieve() []*github.Event { 34 | var allEvents []*github.Event 35 | opt := &github.ListOptions{Page: 1, PerPage: 100} 36 | 37 | for { 38 | events, response, err := e.client.Activity.ListEventsPerformedByUser(e.ctx, e.user, false, opt) 39 | if err != nil { 40 | log.Fatal(err) 41 | } 42 | 43 | allEvents = append(allEvents, events...) 44 | 45 | if !continueToRetrieve(response, events, e.sinceTime) { 46 | break 47 | } 48 | 49 | opt.Page = response.NextPage 50 | } 51 | 52 | return selectEventsInRange(allEvents, e.sinceTime, e.untilTime) 53 | } 54 | 55 | func continueToRetrieve(response *github.Response, events []*github.Event, sinceTime time.Time) bool { 56 | if response.NextPage == 0 { 57 | return false 58 | } 59 | 60 | lastEvent := *events[len(events)-1] 61 | 62 | if lastEvent.CreatedAt.Before(sinceTime.Add(-time.Nanosecond)) { 63 | return false 64 | } 65 | 66 | return true 67 | } 68 | 69 | func selectEventsInRange(events []*github.Event, sinceTime, untilTime time.Time) []*github.Event { 70 | var result []*github.Event 71 | 72 | for _, event := range events { 73 | if isRange(event, sinceTime, untilTime) { 74 | result = append(result, event) 75 | } 76 | } 77 | 78 | return result 79 | } 80 | 81 | func isRange(event *github.Event, sinceTime, untilTime time.Time) bool { 82 | return event.CreatedAt.After(sinceTime.Add(-time.Nanosecond)) && 83 | event.CreatedAt.Before(untilTime.Add(time.Nanosecond)) 84 | } 85 | 86 | func (e *Events) filter(events []*github.Event) []*github.Event { 87 | var result []*github.Event 88 | 89 | for _, event := range events { 90 | if e.debug { 91 | format := NewFormat(e.ctx, e.client, Settings{}, false) 92 | fmt.Printf("[Debug] %s: %v\n", *event.Type, format.Line(event, 999)) 93 | } 94 | 95 | switch *event.Type { 96 | case "IssuesEvent", "IssueCommentEvent", "PullRequestEvent", "PullRequestReviewCommentEvent", "PullRequestReviewEvent": 97 | result = append(result, event) 98 | } 99 | } 100 | 101 | return result 102 | } 103 | 104 | func (e *Events) uniq(events []*github.Event) ([]*github.Event, error) { 105 | m := make(map[string]bool) 106 | var result []*github.Event 107 | 108 | for _, event := range events { 109 | htmlURL, err := htmlURL(event) 110 | if err != nil { 111 | return nil, err 112 | } 113 | 114 | if !m[htmlURL] { 115 | m[htmlURL] = true 116 | result = append(result, event) 117 | } 118 | } 119 | 120 | return result, nil 121 | } 122 | 123 | func htmlURL(event *github.Event) (string, error) { 124 | var result string 125 | payload, err := event.ParsePayload() 126 | if err != nil { 127 | return "", err 128 | } 129 | 130 | switch *event.Type { 131 | case "IssuesEvent": 132 | if e := payload.(*github.IssuesEvent); e.Issue != nil && e.Issue.HTMLURL != nil { 133 | result = *e.Issue.HTMLURL 134 | } 135 | case "IssueCommentEvent": 136 | if e := payload.(*github.IssueCommentEvent); e.Issue != nil && e.Issue.HTMLURL != nil { 137 | result = *e.Issue.HTMLURL 138 | } 139 | case "PullRequestEvent": 140 | if e := payload.(*github.PullRequestEvent); e.PullRequest != nil && e.PullRequest.HTMLURL != nil { 141 | result = *e.PullRequest.HTMLURL 142 | } 143 | case "PullRequestReviewCommentEvent": 144 | if e := payload.(*github.PullRequestReviewCommentEvent); e.PullRequest != nil && e.PullRequest.HTMLURL != nil { 145 | result = *e.PullRequest.HTMLURL 146 | } 147 | case "PullRequestReviewEvent": 148 | if e := payload.(*github.PullRequestReviewEvent); e.PullRequest != nil && e.PullRequest.HTMLURL != nil { 149 | result = *e.PullRequest.HTMLURL 150 | } 151 | } 152 | 153 | return result, nil 154 | } 155 | -------------------------------------------------------------------------------- /lib/settings.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | "os/exec" 10 | "strconv" 11 | "strings" 12 | 13 | // Import ./config/* 14 | _ "github.com/masutaka/github-nippou/v4/statik" 15 | 16 | "github.com/google/go-github/v80/github" 17 | "github.com/rakyll/statik/fs" 18 | "golang.org/x/oauth2" 19 | "gopkg.in/yaml.v3" 20 | ) 21 | 22 | // Settings has configure 23 | type Settings struct { 24 | Format struct { 25 | Subject string 26 | Line string 27 | } 28 | Dictionary struct { 29 | Status struct { 30 | Merged string 31 | Closed string 32 | } 33 | } 34 | URL string 35 | } 36 | 37 | // Init initializes Settings 38 | func (s *Settings) Init(gistID string, accessToken string) error { 39 | var content string 40 | var err error 41 | 42 | if gistID != "" { 43 | ctx := context.Background() 44 | client := getClient(ctx, accessToken) 45 | gist, _, err := client.Gists.Get(ctx, gistID) 46 | if err != nil { 47 | return err 48 | } 49 | 50 | content = *gist.Files["settings.yml"].Content 51 | s.URL = *gist.HTMLURL 52 | } else { 53 | content, err = getDefaultSettingsYml() 54 | if err != nil { 55 | return err 56 | } 57 | s.URL = getDefaultSettingsURL() 58 | } 59 | 60 | return yaml.Unmarshal([]byte(content), s) 61 | } 62 | 63 | func getUser() (string, error) { 64 | if os.Getenv("GITHUB_NIPPOU_USER") != "" { 65 | return os.Getenv("GITHUB_NIPPOU_USER"), nil 66 | } 67 | 68 | output, _ := exec.Command("git", "config", "github-nippou.user").Output() 69 | 70 | if len(output) >= 1 { 71 | return strings.TrimRight(string(output), "\n"), nil 72 | } 73 | 74 | errText := `!!!! GitHub User required. Please execute the following command. !!!! 75 | 76 | $ github-nippou init` 77 | 78 | return "", errors.New(errText) 79 | } 80 | 81 | func getAccessToken() (string, error) { 82 | if os.Getenv("GITHUB_NIPPOU_ACCESS_TOKEN") != "" { 83 | return os.Getenv("GITHUB_NIPPOU_ACCESS_TOKEN"), nil 84 | } 85 | 86 | output, _ := exec.Command("git", "config", "github-nippou.token").Output() 87 | 88 | if len(output) >= 1 { 89 | return strings.TrimRight(string(output), "\n"), nil 90 | } 91 | 92 | errText := `!!!! GitHub Personal access token required. Please execute the following command. !!!! 93 | 94 | $ github-nippou init` 95 | 96 | return "", errors.New(errText) 97 | } 98 | 99 | func getGistID() string { 100 | if os.Getenv("GITHUB_NIPPOU_SETTINGS_GIST_ID") != "" { 101 | return os.Getenv("GITHUB_NIPPOU_SETTINGS_GIST_ID") 102 | } 103 | 104 | output, _ := exec.Command("git", "config", "github-nippou.settings-gist-id").Output() 105 | 106 | if len(output) == 1 { 107 | return "" 108 | } 109 | 110 | return strings.TrimRight(string(output), "\n") 111 | } 112 | 113 | func getParallelNum() (int, error) { 114 | if os.Getenv("GITHUB_NIPPOU_THREAD_NUM") != "" { 115 | return strconv.Atoi(os.Getenv("GITHUB_NIPPOU_THREAD_NUM")) 116 | } 117 | 118 | output, _ := exec.Command("git", "config", "github-nippou.thread-num").Output() 119 | 120 | if len(output) >= 1 { 121 | return strconv.Atoi(strings.TrimRight(string(output), "\n")) 122 | } 123 | 124 | return 5, nil 125 | } 126 | 127 | func getClient(ctx context.Context, accessToken string) *github.Client { 128 | sts := oauth2.StaticTokenSource( 129 | &oauth2.Token{AccessToken: accessToken}, 130 | ) 131 | return github.NewClient(oauth2.NewClient(ctx, sts)) 132 | } 133 | 134 | func getClientScopes(ctx context.Context, client *github.Client) ([]string, error) { 135 | _, response, err := client.Users.Get(ctx, "") 136 | return strings.Split(response.Header.Get("X-OAuth-Scopes"), ", "), err 137 | } 138 | 139 | func createGist(ctx context.Context, client *github.Client) (*github.Gist, *github.Response, error) { 140 | content, err := getDefaultSettingsYml() 141 | if err != nil { 142 | return nil, nil, err 143 | } 144 | 145 | gistFiles := make(map[github.GistFilename]github.GistFile, 1) 146 | gistFiles["settings.yml"] = github.GistFile{ 147 | Content: github.String(content), 148 | } 149 | 150 | gist := &github.Gist{ 151 | Description: github.String("github-nippou settings"), 152 | Public: github.Bool(true), 153 | Files: gistFiles, 154 | } 155 | 156 | return client.Gists.Create(ctx, gist) 157 | } 158 | 159 | func getDefaultSettingsURL() string { 160 | return fmt.Sprintf("https://github.com/masutaka/github-nippou/blob/v%s/config/settings.yml", Version) 161 | } 162 | 163 | func getDefaultSettingsYml() (string, error) { 164 | statikFS, err := fs.New() 165 | if err != nil { 166 | return "", err 167 | } 168 | 169 | file, err := statikFS.Open("/settings.yml") 170 | if err != nil { 171 | return "", err 172 | } 173 | 174 | defer file.Close() 175 | 176 | yml, err := ioutil.ReadAll(file) 177 | if err != nil { 178 | return "", err 179 | } 180 | 181 | return string(yml), nil 182 | } 183 | -------------------------------------------------------------------------------- /lib/init.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | "os/exec" 8 | "strings" 9 | "time" 10 | ) 11 | 12 | // Init initializes github-nippou settings 13 | func Init() error { 14 | fmt.Print("** github-nippou Initialization **\n") 15 | 16 | if err := setUser(); err != nil { 17 | return err 18 | } 19 | 20 | time.Sleep(500 * time.Millisecond) 21 | ctx := context.Background() 22 | 23 | if err := setAccessToken(ctx); err != nil { 24 | return err 25 | } 26 | 27 | time.Sleep(500 * time.Millisecond) 28 | 29 | return createAndSetGist(ctx) 30 | } 31 | 32 | func setUser() error { 33 | fmt.Print(` 34 | == [Step: 1/3] GitHub user == 35 | 36 | `) 37 | 38 | var msg string 39 | 40 | if _, err := getUser(); err == nil { 41 | msg = "Already initialized." 42 | } else { 43 | var user string 44 | var answer string = "Y" 45 | 46 | fmt.Print("What's your GitHub account? ") 47 | fmt.Scanln(&user) 48 | 49 | if len(user) >= 1 { 50 | fmt.Printf(` 51 | The following command will be executed. 52 | 53 | $ git config --global github-nippou.user %s 54 | 55 | `, user) 56 | 57 | fmt.Print("Are you sure? [Y/n] ") 58 | fmt.Scanln(&answer) 59 | 60 | if strings.ToUpper(answer[0:1]) != "Y" { 61 | return errors.New("Canceled") 62 | } 63 | 64 | cmd := exec.Command("git", "config", "--global", "github-nippou.user", user) 65 | if err := cmd.Run(); err != nil { 66 | return err 67 | } 68 | 69 | msg = "Thanks!" 70 | } 71 | } 72 | 73 | fmt.Printf(`%s You can get it with the following command. 74 | 75 | $ git config --global github-nippou.user 76 | 77 | `, msg) 78 | 79 | return nil 80 | } 81 | 82 | func setAccessToken(ctx context.Context) error { 83 | fmt.Print(` 84 | == [Step: 2/3] GitHub personal access token == 85 | 86 | To get new token with ` + "`repo`" + ` and ` + "`gist`" + ` scope, visit 87 | https://github.com/settings/tokens/new 88 | 89 | `) 90 | 91 | var msg string 92 | 93 | accessToken, err := getAccessToken() 94 | 95 | if err == nil { 96 | msg = "Already initialized." 97 | } else { 98 | var answer string = "Y" 99 | 100 | fmt.Print("What's your GitHub personal access token? ") 101 | fmt.Scanln(&accessToken) 102 | 103 | if len(accessToken) >= 1 { 104 | fmt.Printf(` 105 | The following command will be executed. 106 | 107 | $ git config --global github-nippou.token %s 108 | 109 | `, accessToken) 110 | 111 | fmt.Print("Are you sure? [Y/n] ") 112 | fmt.Scanln(&answer) 113 | 114 | if strings.ToUpper(answer[0:1]) != "Y" { 115 | return errors.New("Canceled") 116 | } 117 | 118 | cmd := exec.Command("git", "config", "--global", "github-nippou.token", accessToken) 119 | if err := cmd.Run(); err != nil { 120 | return err 121 | } 122 | 123 | msg = "Thanks!" 124 | } 125 | } 126 | 127 | fmt.Printf(`%s You can get it with the following command. 128 | 129 | $ git config --global github-nippou.token 130 | 131 | `, msg) 132 | 133 | scopes, err := getClientScopes(ctx, getClient(ctx, accessToken)) 134 | if err != nil { 135 | return err 136 | } 137 | 138 | if !isValidScopes(scopes) { 139 | return errors.New(`!!!! ` + "`repo`" + ` and ` + "`gist`" + ` scopes are required. !!!! 140 | 141 | You need personal access token which has ` + "`repo`" + ` and ` + "`gist`" + ` 142 | scopes. Please add these scopes to your personal access 143 | token, visit https://github.com/settings/tokens 144 | 145 | `) 146 | 147 | } 148 | 149 | return nil 150 | } 151 | 152 | func isValidScopes(scopes []string) bool { 153 | var found1, found2 bool 154 | 155 | for _, v := range scopes { 156 | if v == "repo" { 157 | found1 = true 158 | } 159 | 160 | if v == "gist" { 161 | found2 = true 162 | } 163 | } 164 | 165 | return found1 && found2 166 | } 167 | 168 | func createAndSetGist(ctx context.Context) error { 169 | fmt.Print(` 170 | == [Step: 3/3] Gist (optional) == 171 | 172 | `) 173 | 174 | var msg string 175 | 176 | if len(getGistID()) >= 1 { 177 | msg = "Already initialized." 178 | } else { 179 | var answer string = "N" 180 | 181 | fmt.Printf(`1. Create a gist with the content of %s 182 | 2. The following command will be executed 183 | 184 | $ git config --global github-nippou.settings-gist-id 185 | 186 | `, getDefaultSettingsURL()) 187 | 188 | fmt.Print("Are you sure? [y/N] ") 189 | fmt.Scanln(&answer) 190 | 191 | if strings.ToUpper(answer[0:1]) == "N" { 192 | return nil 193 | } 194 | 195 | accessToken, err := getAccessToken() 196 | if err != nil { 197 | return err 198 | } 199 | 200 | gist, _, err := createGist(ctx, getClient(ctx, accessToken)) 201 | if err != nil { 202 | return err 203 | } 204 | 205 | cmd := exec.Command("git", "config", "--global", "github-nippou.settings-gist-id", *gist.ID) 206 | if err := cmd.Run(); err != nil { 207 | return err 208 | } 209 | 210 | msg = "Thanks!" 211 | } 212 | 213 | fmt.Printf(`%s You can get it with the following command. 214 | 215 | $ git config --global github-nippou.settings-gist-id 216 | 217 | And you can easily open the gist URL with web browser. 218 | 219 | $ github-nippou open-settings 220 | 221 | `, msg) 222 | 223 | return nil 224 | } 225 | -------------------------------------------------------------------------------- /lib/format.go: -------------------------------------------------------------------------------- 1 | package lib 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "fmt" 7 | "regexp" 8 | "sort" 9 | "strings" 10 | "text/template" 11 | 12 | "github.com/google/go-github/v80/github" 13 | ) 14 | 15 | // Format is Formatter 16 | type Format struct { 17 | ctx context.Context 18 | client *github.Client 19 | settings Settings 20 | debug bool 21 | } 22 | 23 | // NewFormat is an initializer 24 | func NewFormat(ctx context.Context, client *github.Client, settings Settings, debug bool) *Format { 25 | return &Format{ctx: ctx, client: client, settings: settings, debug: debug} 26 | } 27 | 28 | // Line is line information 29 | type Line struct { 30 | title string 31 | repoName string 32 | url string 33 | user string 34 | status string 35 | } 36 | 37 | // NewLineByIssue is an initializer by Issue 38 | func NewLineByIssue(repoName string, issue github.Issue) Line { 39 | return Line{ 40 | title: *issue.Title, 41 | repoName: repoName, 42 | url: *issue.HTMLURL, 43 | user: *issue.User.Login, 44 | status: getIssueStatus(issue), 45 | } 46 | } 47 | 48 | // NewLineByPullRequest is an initializer by PR 49 | func NewLineByPullRequest(repoName string, pr github.PullRequest) Line { 50 | return Line{ 51 | title: *pr.Title, 52 | repoName: repoName, 53 | url: *pr.HTMLURL, 54 | user: *pr.User.Login, 55 | status: getPullRequestStatus(pr), 56 | } 57 | } 58 | 59 | // Line returns Issue/PR info retrieving from GitHub 60 | func (f *Format) Line(event *github.Event, i int) Line { 61 | payload := event.Payload() 62 | var line Line 63 | 64 | switch *event.Type { 65 | case "IssuesEvent": 66 | e := payload.(*github.IssuesEvent) 67 | issue := getIssue(f.ctx, f.client, *event.Repo.Name, *e.Issue.Number) 68 | 69 | if issue != nil { 70 | if issue.PullRequestLinks == nil { 71 | line = NewLineByIssue(*event.Repo.Name, *issue) 72 | } else { 73 | pr := getPullRequest(f.ctx, f.client, *event.Repo.Name, *e.Issue.Number) 74 | line = NewLineByPullRequest(*event.Repo.Name, *pr) 75 | } 76 | } else { 77 | line = NewLineByIssue(*event.Repo.Name, *e.Issue) 78 | } 79 | case "IssueCommentEvent": 80 | e := payload.(*github.IssueCommentEvent) 81 | issue := getIssue(f.ctx, f.client, *event.Repo.Name, *e.Issue.Number) 82 | 83 | if issue != nil { 84 | if issue.PullRequestLinks == nil { 85 | line = NewLineByIssue(*event.Repo.Name, *issue) 86 | } else { 87 | pr := getPullRequest(f.ctx, f.client, *event.Repo.Name, *e.Issue.Number) 88 | line = NewLineByPullRequest(*event.Repo.Name, *pr) 89 | } 90 | } else { 91 | line = NewLineByIssue(*event.Repo.Name, *e.Issue) 92 | } 93 | case "PullRequestEvent": 94 | e := payload.(*github.PullRequestEvent) 95 | pr := getPullRequest(f.ctx, f.client, *event.Repo.Name, e.GetNumber()) 96 | if pr != nil { 97 | line = NewLineByPullRequest(*event.Repo.Name, *pr) 98 | } else { 99 | line = NewLineByPullRequest(*event.Repo.Name, *e.PullRequest) 100 | } 101 | case "PullRequestReviewCommentEvent": 102 | e := payload.(*github.PullRequestReviewCommentEvent) 103 | pr := getPullRequest(f.ctx, f.client, *event.Repo.Name, *e.PullRequest.Number) 104 | if pr != nil { 105 | line = NewLineByPullRequest(*event.Repo.Name, *pr) 106 | } else { 107 | line = NewLineByPullRequest(*event.Repo.Name, *e.PullRequest) 108 | } 109 | case "PullRequestReviewEvent": 110 | e := payload.(*github.PullRequestReviewEvent) 111 | pr := getPullRequest(f.ctx, f.client, *event.Repo.Name, *e.PullRequest.Number) 112 | if pr != nil { 113 | line = NewLineByPullRequest(*event.Repo.Name, *pr) 114 | } else { 115 | line = NewLineByPullRequest(*event.Repo.Name, *e.PullRequest) 116 | } 117 | } 118 | 119 | if f.debug { 120 | fmt.Printf("[Debug] %2d %s: %v\n", i, *event.Type, line) 121 | } 122 | 123 | return line 124 | } 125 | 126 | func getIssue(ctx context.Context, client *github.Client, repoFullName string, number int) *github.Issue { 127 | owner, repo := getOwnerRepo(repoFullName) 128 | issue, _, _ := client.Issues.Get(ctx, owner, repo, number) 129 | return issue 130 | } 131 | 132 | func getPullRequest(ctx context.Context, client *github.Client, repoFullName string, number int) *github.PullRequest { 133 | owner, repo := getOwnerRepo(repoFullName) 134 | pr, _, _ := client.PullRequests.Get(ctx, owner, repo, number) 135 | return pr 136 | } 137 | 138 | func getIssueStatus(issue github.Issue) string { 139 | result := "" 140 | if *issue.State == "closed" { 141 | result = "closed" 142 | } 143 | return result 144 | } 145 | 146 | func getPullRequestStatus(pr github.PullRequest) string { 147 | result := "" 148 | if *pr.Merged { 149 | result = "merged" 150 | } else if *pr.State == "closed" { 151 | result = "closed" 152 | } 153 | return result 154 | } 155 | 156 | func getOwnerRepo(repoFullName string) (string, string) { 157 | s := strings.Split(repoFullName, "/") 158 | owner := s[0] 159 | repo := s[1] 160 | return owner, repo 161 | } 162 | 163 | // All returns all lines which are formatted and sorted 164 | func (f *Format) All(lines Lines) (string, error) { 165 | var result, prevRepoName, currentRepoName string 166 | 167 | sort.Sort(lines) 168 | 169 | for _, line := range lines { 170 | currentRepoName = line.repoName 171 | 172 | if currentRepoName != prevRepoName { 173 | prevRepoName = currentRepoName 174 | result += fmt.Sprintf("\n%s\n\n", formatSubject(f.settings, currentRepoName)) 175 | } 176 | 177 | result += fmt.Sprintf("%s\n", formatLine(f.settings, line)) 178 | } 179 | 180 | return result, nil 181 | } 182 | 183 | // Lines has sort.Interface 184 | type Lines []Line 185 | 186 | func (l Lines) Len() int { 187 | return len(l) 188 | } 189 | 190 | func (l Lines) Swap(i, j int) { 191 | l[i], l[j] = l[j], l[i] 192 | } 193 | 194 | func (l Lines) Less(i, j int) bool { 195 | return l[i].url < l[j].url 196 | } 197 | 198 | func formatSubject(settings Settings, repoName string) string { 199 | formatSubject := convertNamedParameters(settings.Format.Subject) 200 | 201 | m := map[string]interface{}{"subject": repoName} 202 | t := template.Must(template.New("").Parse(formatSubject)) 203 | 204 | var rendered bytes.Buffer 205 | t.Execute(&rendered, m) 206 | 207 | return rendered.String() 208 | } 209 | 210 | func formatLine(settings Settings, line Line) string { 211 | formatLine := convertNamedParameters(settings.Format.Line) 212 | 213 | m := map[string]interface{}{ 214 | "title": line.title, 215 | "url": line.url, 216 | "user": line.user, 217 | "status": formatStatus(settings, line.status), 218 | } 219 | t := template.Must(template.New("").Parse(formatLine)) 220 | 221 | var rendered bytes.Buffer 222 | t.Execute(&rendered, m) 223 | 224 | return strings.TrimSpace(rendered.String()) 225 | } 226 | 227 | func formatStatus(settings Settings, status string) string { 228 | switch status { 229 | case "merged": 230 | return settings.Dictionary.Status.Merged 231 | case "closed": 232 | return settings.Dictionary.Status.Closed 233 | default: 234 | return "" 235 | } 236 | } 237 | 238 | // "%{hoge}" => "{{.hoge}}" 239 | func convertNamedParameters(str string) string { 240 | re := regexp.MustCompile("%{([^}]+)}") 241 | return re.ReplaceAllString(str, "{{.$1}}") 242 | } 243 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # github-nippou 2 | 3 | [![Test](https://github.com/masutaka/github-nippou/actions/workflows/test.yml/badge.svg?branch=main)][Test] 4 | [![Go Report Card](https://goreportcard.com/badge/github.com/masutaka/github-nippou/v4)][Go Report Card] 5 | [![Go Reference](https://pkg.go.dev/badge/github.com/masutaka/github-nippou/v4.svg)][Go Reference] 6 | [![Ask DeepWiki](https://deepwiki.com/badge.svg)][DeepWiki] 7 | 8 | [Test]: https://github.com/masutaka/github-nippou/actions/workflows/test.yml?query=branch%3Amain 9 | [Go Report Card]: https://goreportcard.com/report/github.com/masutaka/github-nippou/v4 10 | [Go Reference]: https://pkg.go.dev/github.com/masutaka/github-nippou/v4 11 | [DeepWiki]: https://deepwiki.com/masutaka/github-nippou 12 | 13 | Print today's your GitHub activity for issues and pull requests. 14 | 15 | This is a helpful CLI when you write a daily report in reference to GitHub. Nippou is a japanese word which means a daily report. 16 | 17 | ## Installation 18 | 19 | Grab the latest binary from the [releases](https://github.com/masutaka/github-nippou/releases) page. 20 | 21 | On macOS you can install or upgrade to the latest released version with Homebrew: 22 | 23 | ``` 24 | $ brew install masutaka/tap/github-nippou 25 | $ brew upgrade github-nippou 26 | ``` 27 | 28 | If you're interested in hacking on `github-nippou`, you can install via `go install`: 29 | 30 | ``` 31 | $ go install github.com/masutaka/github-nippou/v4@latest 32 | ``` 33 | 34 | Also you can use make command, it's easy to build `github-nippou`: 35 | 36 | ``` 37 | $ make deps 38 | $ make 39 | $ ./github-nippou 40 | ``` 41 | 42 | ## Setup 43 | 44 | $ github-nippou init 45 | 46 | The initialization will be update your [Git global configuration file](https://git-scm.com/docs/git-config#Documentation/git-config.txt-XDGCONFIGHOMEgitconfig). 47 | 48 | 1. Add `github-nippou.user` 49 | 2. Add `github-nippou.token` 50 | 3. Create Gist, and add `github-nippou.settings-gist-id` for customizing output format (optional) 51 | 52 | ## Usage 53 | 54 | ``` 55 | $ github-nippou help 56 | Print today's your GitHub activity for issues and pull requests 57 | 58 | Usage: 59 | github-nippou [flags] 60 | github-nippou [command] 61 | 62 | Available Commands: 63 | completion Generate the autocompletion script for the specified shell 64 | help Help about any command 65 | init Initialize github-nippou settings 66 | list Print today's your GitHub activity for issues and pull requests 67 | open-settings Open settings url with web browser 68 | version Print version 69 | 70 | Flags: 71 | -d, --debug Debug mode 72 | -h, --help help for github-nippou 73 | -s, --since-date string Retrieves GitHub user_events since the date (default "20231028") 74 | -u, --until-date string Retrieves GitHub user_events until the date (default "20231028") 75 | 76 | Use "github-nippou [command] --help" for more information about a command. 77 | ``` 78 | 79 | You can get your GitHub Nippou on today. 80 | 81 | ``` 82 | $ github-nippou 83 | 84 | ### masutaka/github-nippou 85 | 86 | * [v3.0.0](https://github.com/masutaka/github-nippou/issues/59) by @[masutaka](https://github.com/masutaka) 87 | * [Enable to inject settings_gist_id instead of the settings](https://github.com/masutaka/github-nippou/pull/63) by @[masutaka](https://github.com/masutaka) **merged!** 88 | * [Add y/n prompt to sub command \`init\`](https://github.com/masutaka/github-nippou/pull/64) by @[masutaka](https://github.com/masutaka) **merged!** 89 | * [Add sub command \`open-settings\`](https://github.com/masutaka/github-nippou/pull/65) by @[masutaka](https://github.com/masutaka) **merged!** 90 | * [Dockerize](https://github.com/masutaka/github-nippou/pull/66) by @[masutaka](https://github.com/masutaka) **merged!** 91 | ``` 92 | 93 | ## Usage Examples as a library 94 | 95 | The following projects use github-nippou as a library: 96 | 97 | * https://github.com/ryoppippi/gh-nippou 98 | * gh CLI extension for github-nippou 99 | * https://github.com/MH4GF/github-nippou-web 100 | * A web app version of github-nippou 101 | * https://github.com/NoritakaIkeda/GitJournal 102 | * A web app that can post github-nippou output to a GitHub Discussion 103 | 104 | ## Optional: Customize Output Format 105 | 106 | Customize the list output format as needed. Configurations are stored in a Gist. 107 | Running `github-nippou init` creates your Gist and adds its ID to `github-nippou.settings-gist-id`. 108 | 109 | View the default configuration [here](./config/settings.yml). 110 | 111 | ### Available Properties 112 | 113 | #### `format.subject` 114 | 115 | | Property | Type | Description | 116 | | --- | --- | --- | 117 | | `subject` | `string` | Represents the repository name. | 118 | 119 | #### `format.line` 120 | 121 | | Property | Type | Description | 122 | | --- | --- | --- | 123 | | `user` | `string` | Displays the username of author of the issue or pull request. | 124 | | `title` | `string` | Displays the title of the issue or pull request. | 125 | | `url` | `string` | Displays the URL of the issue or pull request. | 126 | | `status` | `string \| nil` | Displays the status, utilizing the format in `dictionary.status`. | 127 | 128 | #### `format.dictionary.status` 129 | 130 | | Property | Type | Description | 131 | | --- | --- | --- | 132 | | `closed` | `string` | Displays when the issue or pull request is closed. | 133 | | `merged` | `string` | Displays when the pull request is merged. Applicable to pull requests only. | 134 | 135 | ## Limitations and Latency 136 | 137 | github-nippou uses the GitHub [List events for the authenticated user](https://docs.github.com/ja/rest/activity/events?apiVersion=2022-11-28#list-events-for-the-authenticated-user) API. 138 | 139 | :link: [REST API endpoints for events \- GitHub Docs](https://docs.github.com/en/rest/activity/events?apiVersion=2022-11-28) 140 | 141 | > Only events created within the past 90 days will be included in timelines. Events older than 90 days will not be included (even if the total number of events in the timeline is less than 300). 142 | 143 | github-nippou can create past daily reports, but the above limitations apply. 144 | 145 | > This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. 146 | 147 | As of July 29, 2024, the above is a note regarding the [List repository events](https://docs.github.com/en/enterprise-cloud@latest/rest/activity/events?apiVersion=2022-11-28#list-repository-events) API, but I confirmed with GitHub support that it applies to all Event APIs. 148 | 149 | ## Contributing 150 | 151 | 1. Fork it ( https://github.com/masutaka/github-nippou/fork ) 152 | 2. Create your feature branch (`git checkout -b my-new-feature`) 153 | 3. Commit your changes (`git commit -am 'Add some feature'`) 154 | 4. Push to the branch (`git push origin my-new-feature`) 155 | 5. Create a new Pull Request 156 | 157 | ## Contributors 158 | 159 | 160 | 161 | 162 | 163 | *Made with [contrib.rocks](https://contrib.rocks).* 164 | 165 | ## External articles 166 | 167 | In Japanese 168 | 169 | 1. [いつも日報書くときに使っているスクリプトをGem化した | マスタカの ChangeLog メモ](https://masutaka.net/2014-12-07-1/) 170 | 1. [github-nippou v0.1.1 released | マスタカの ChangeLog メモ](https://masutaka.net/2014-12-18-1/) 171 | 1. [github-nippou v1.1.0 and v1.1.1 released | マスタカの ChangeLog メモ](https://masutaka.net/2016-03-21-1/) 172 | 1. [github-nippou v1.2.0 released | マスタカの ChangeLog メモ](https://masutaka.net/2016-03-23-1/) 173 | 1. [社内勉強会で github-nippou v2.0.0 をライブリリースした | マスタカの ChangeLog メモ](https://masutaka.net/2016-04-09-1/) 174 | 1. [github-nippou v3.0.0 released | マスタカの ChangeLog メモ](https://masutaka.net/2017-08-07-1/) 175 | 1. [github-nippou という gem を golang で書き直したという発表をした - Feedforce Developer Blog](https://developer.feedforce.jp/entry/2017/10/16/150000) 176 | 1. [github-nippou を golang で書き換えて v4.0.1 リリースしてました | マスタカの ChangeLog メモ](https://masutaka.net/2017-10-22-1/) 177 | 1. [github-nippou のリリースを gox+ghr の手動実行から、tagpr+goreleaser の自動実行に変えた | マスタカの ChangeLog メモ](https://masutaka.net/2023-11-14-1/) 178 | 1. [github\-nippou の Web 版を App Router \+ Go \+ Vercel で作った \| Hirotaka Miyagi](https://www.mh4gf.dev/articles/github-nippou-web) 179 | 1. [github\-nippou のリリース時に formula ファイルも自動更新するようにした \| マスタカの ChangeLog メモ](https://masutaka.net/2024-07-30-1/) 180 | 1. [github-nippou 10 周年 🎉 | マスタカの ChangeLog メモ](https://masutaka.net/2024-12-07-1/) 181 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [v4.2.43](https://github.com/masutaka/github-nippou/compare/v4.2.42...v4.2.43) - 2025-12-20 4 | ### Maintenance :technologist: 5 | - Migrate route06/actions to masutaka/actions by @masutaka in https://github.com/masutaka/github-nippou/pull/295 6 | - Pin GitHub Actions versions to specific commit SHAs by @masutaka in https://github.com/masutaka/github-nippou/pull/297 7 | - Bump google/go-github from v69 to v80 by @masutaka in https://github.com/masutaka/github-nippou/pull/298 8 | 9 | ## [v4.2.42](https://github.com/masutaka/github-nippou/compare/v4.2.41...v4.2.42) - 2025-12-07 10 | ### Maintenance :technologist: 11 | - Bump golang.org/x/oauth2 from 0.32.0 to 0.33.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/293 12 | 13 | ## [v4.2.41](https://github.com/masutaka/github-nippou/compare/v4.2.40...v4.2.41) - 2025-11-08 14 | ### Maintenance :technologist: 15 | - Bump golang.org/x/oauth2 from 0.31.0 to 0.32.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/287 16 | 17 | ## [v4.2.40](https://github.com/masutaka/github-nippou/compare/v4.2.39...v4.2.40) - 2025-11-05 18 | ### Fix bug :bug: 19 | - fix: add nil checks in htmlURL to prevent panic by @MH4GF in https://github.com/masutaka/github-nippou/pull/289 20 | ### Maintenance :technologist: 21 | - Bump Songmu/tagpr from 1.7.0 to 1.9.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/284 22 | - Bump reviewdog/action-actionlint from 1.67.0 to 1.68.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/288 23 | ### Other Changes 24 | - Introduce coderabbit and remove PR-Agent by @masutaka in https://github.com/masutaka/github-nippou/pull/286 25 | 26 | ## [v4.2.39](https://github.com/masutaka/github-nippou/compare/v4.2.38...v4.2.39) - 2025-09-13 27 | ### Maintenance :technologist: 28 | - Revert "Migrate brews to homebrew_casks in .goreleaser.yaml" by @masutaka in https://github.com/masutaka/github-nippou/pull/281 29 | 30 | ## [v4.2.38](https://github.com/masutaka/github-nippou/compare/v4.2.37...v4.2.38) - 2025-09-13 31 | ### Maintenance :technologist: 32 | - Fix release settings by @masutaka in https://github.com/masutaka/github-nippou/pull/279 33 | 34 | ## [v4.2.37](https://github.com/masutaka/github-nippou/compare/v4.2.36...v4.2.37) - 2025-09-13 35 | ### Maintenance :technologist: 36 | - Bump Songmu/tagpr from 1.6.1 to 1.7.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/262 37 | - Add falling sound to pushover at CI failure by @masutaka in https://github.com/masutaka/github-nippou/pull/265 38 | - Refactor GH Actions workflows by @masutaka in https://github.com/masutaka/github-nippou/pull/266 39 | - Bump route06/actions from 2.6.0 to 2.7.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/267 40 | - Add GitHub Actions to the list of languages for scheduled CodeQL execution by @masutaka in https://github.com/masutaka/github-nippou/pull/268 41 | - ci: add explicit permissions to address CodeQL findings by @masutaka in https://github.com/masutaka/github-nippou/pull/269 42 | - Bump actions/checkout from 4 to 5 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/272 43 | - Bump reviewdog/action-actionlint from 1.65.2 to 1.66.1 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/273 44 | - Update dependabot setting by @masutaka in https://github.com/masutaka/github-nippou/pull/274 45 | - Bump reviewdog/action-actionlint from 1.66.1 to 1.67.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/275 46 | - Bump actions/setup-go from 5 to 6 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/276 47 | - Bump github.com/spf13/cobra from 1.9.1 to 1.10.1 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/277 48 | - Bump golang.org/x/oauth2 from 0.30.0 to 0.31.0 by @dependabot[bot] in https://github.com/masutaka/github-nippou/pull/278 49 | ### Documentation :memo: 50 | - Remove FOSSA badges by @masutaka in https://github.com/masutaka/github-nippou/pull/264 51 | - Update README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/270 52 | - Add DeepWiki badge by @masutaka in https://github.com/masutaka/github-nippou/pull/271 53 | 54 | ## [v4.2.36](https://github.com/masutaka/github-nippou/compare/v4.2.35...v4.2.36) - 2025-06-02 55 | ### Maintenance :technologist: 56 | - Bump Songmu/tagpr from 1.5.2 to 1.6.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/259 57 | - Bump golang.org/x/oauth2 from 0.29.0 to 0.30.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/260 58 | 59 | ## [v4.2.35](https://github.com/masutaka/github-nippou/compare/v4.2.34...v4.2.35) - 2025-05-21 60 | ### Maintenance :technologist: 61 | - Bump reviewdog/action-actionlint from 1.64.1 to 1.65.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/250 62 | - Bump route06/actions from 2.5.0 to 2.6.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/249 63 | - Bump github.com/google/go-github/v69 from 69.0.0 to 69.2.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/248 64 | - Bump github.com/spf13/cobra from 1.8.1 to 1.9.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/246 65 | - Bump reviewdog/action-actionlint from 1.65.0 to 1.65.2 by @dependabot in https://github.com/masutaka/github-nippou/pull/252 66 | - Bump Songmu/tagpr from 1.5.1 to 1.5.2 by @dependabot in https://github.com/masutaka/github-nippou/pull/255 67 | - Bump actions/create-github-app-token from 1 to 2 by @dependabot in https://github.com/masutaka/github-nippou/pull/256 68 | - Bump golang.org/x/oauth2 from 0.25.0 to 0.29.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/254 69 | ### Other Changes 70 | - Update PR template by @masutaka in https://github.com/masutaka/github-nippou/pull/243 71 | - Update PR template by @masutaka in https://github.com/masutaka/github-nippou/pull/245 72 | - Make masutaka a reviewer, not an assigner, for dependabot PR by @masutaka in https://github.com/masutaka/github-nippou/pull/251 73 | - Migrate the reviewers of dependabot version updates to CODEOWNERS file by @masutaka in https://github.com/masutaka/github-nippou/pull/257 74 | - $ go mod tidy by @masutaka in https://github.com/masutaka/github-nippou/pull/258 75 | 76 | ## [v4.2.34](https://github.com/masutaka/github-nippou/compare/v4.2.33...v4.2.34) - 2025-02-10 77 | ### Fix bug :bug: 78 | - Fix goreleaser error by @masutaka in https://github.com/masutaka/github-nippou/pull/241 79 | ### Maintenance :technologist: 80 | - Bump reviewdog/action-actionlint from 1.57.0 to 1.61.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/233 81 | - Bump Songmu/tagpr from 1.5.0 to 1.5.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/235 82 | - Bump reviewdog/action-actionlint from 1.61.0 to 1.64.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/236 83 | - Bump golang.org/x/oauth2 from 0.24.0 to 0.25.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/234 84 | - Fix the warning of reviewdog/action-actionlint by @masutaka in https://github.com/masutaka/github-nippou/pull/237 85 | - Bump google/go-github to v69 by @masutaka in https://github.com/masutaka/github-nippou/pull/240 86 | ### Documentation :memo: 87 | - Update External articles in README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/229 88 | - Add NoritakaIkeda/GitJournal link to README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/239 89 | ### Other Changes 90 | - Introduce PR-Agent by @masutaka in https://github.com/masutaka/github-nippou/pull/238 91 | 92 | ## [v4.2.33](https://github.com/masutaka/github-nippou/compare/v4.2.32...v4.2.33) - 2024-12-01 93 | ### Maintenance :technologist: 94 | - Introduce Dependency Review to CI by @masutaka in https://github.com/masutaka/github-nippou/pull/222 95 | - Bump route06/actions from 2.4.1 to 2.5.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/225 96 | - Bump Songmu/tagpr from 1.4.2 to 1.5.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/224 97 | - Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/228 98 | 99 | ## [v4.2.32](https://github.com/masutaka/github-nippou/compare/v4.2.31...v4.2.32) - 2024-10-01 100 | ### Maintenance :technologist: 101 | - Bump route06/actions from 2.4.0 to 2.4.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/218 102 | - Bump Songmu/tagpr from 1.4.0 to 1.4.2 by @dependabot in https://github.com/masutaka/github-nippou/pull/217 103 | - Bump reviewdog/action-actionlint from 1.54.0 to 1.57.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/219 104 | - Bump golang.org/x/oauth2 from 0.22.0 to 0.23.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/220 105 | 106 | ## [v4.2.31](https://github.com/masutaka/github-nippou/compare/v4.2.30...v4.2.31) - 2024-09-23 107 | ### Maintenance :technologist: 108 | - Bump Songmu/tagpr from 1.3.0 to 1.4.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/209 109 | - Bump golang.org/x/oauth2 from 0.21.0 to 0.22.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/210 110 | - Add CodeQL job to GitHub Actions workflow by @masutaka in https://github.com/masutaka/github-nippou/pull/212 111 | ### Documentation :memo: 112 | - Update badges by @masutaka in https://github.com/masutaka/github-nippou/pull/200 113 | - Add contributors badge using contrib.rocks by @masutaka in https://github.com/masutaka/github-nippou/pull/202 114 | - Adjust FOSSA badge by @masutaka in https://github.com/masutaka/github-nippou/pull/204 115 | - Add license scan report and status by @fossabot in https://github.com/masutaka/github-nippou/pull/203 116 | - Fix FOSSA badge by @masutaka in https://github.com/masutaka/github-nippou/pull/208 117 | - Add SECURITY.md by @masutaka in https://github.com/masutaka/github-nippou/pull/211 118 | - Remove CodeQL badge by @masutaka in https://github.com/masutaka/github-nippou/pull/213 119 | ### Other Changes 120 | - Fix the GoReleaser deprecation by @masutaka in https://github.com/masutaka/github-nippou/pull/215 121 | 122 | ## [v4.2.30](https://github.com/masutaka/github-nippou/compare/v4.2.29...v4.2.30) - 2024-08-02 123 | ### Maintenance :technologist: 124 | - Update .github/release.yml by @masutaka in https://github.com/masutaka/github-nippou/pull/197 125 | - Bump reviewdog/action-actionlint from 1.51.0 to 1.54.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/198 126 | ### Documentation :memo: 127 | - Add "Limitations and Latency" to README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/194 128 | - Add external article to README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/196 129 | ### Other Changes 130 | - Fix go toolchain version by @masutaka in https://github.com/masutaka/github-nippou/pull/199 131 | 132 | ## [v4.2.29](https://github.com/masutaka/github-nippou/compare/v4.2.28...v4.2.29) - 2024-07-18 133 | ### Maintenance :technologist: 134 | - Fix missing CI trigger of Release PR by @masutaka in https://github.com/masutaka/github-nippou/pull/190 135 | - Fix the permission of tagpr job by @masutaka in https://github.com/masutaka/github-nippou/pull/191 136 | - Bump google/go-github to v63 by @masutaka in https://github.com/masutaka/github-nippou/pull/193 137 | 138 | ## [v4.2.28](https://github.com/masutaka/github-nippou/compare/v4.2.27...v4.2.28) - 2024-07-02 139 | ### Maintenance :technologist: 140 | - Revert "Refactor release workflow" by @masutaka in https://github.com/masutaka/github-nippou/pull/186 141 | 142 | ## [v4.2.27](https://github.com/masutaka/github-nippou/compare/v4.2.26...v4.2.27) - 2024-07-02 143 | ### Maintenance :technologist: 144 | - Refactor release workflow by @masutaka in https://github.com/masutaka/github-nippou/pull/184 145 | 146 | ## [v4.2.26](https://github.com/masutaka/github-nippou/compare/v4.2.25...v4.2.26) - 2024-07-02 147 | ### Maintenance :technologist: 148 | - Fix .goreleaser.yaml part7 by @masutaka in https://github.com/masutaka/github-nippou/pull/182 149 | 150 | ## [v4.2.25](https://github.com/masutaka/github-nippou/compare/v4.2.24...v4.2.25) - 2024-07-02 151 | ### Maintenance :technologist: 152 | - Fix .goreleaser.yaml part6 by @masutaka in https://github.com/masutaka/github-nippou/pull/180 153 | 154 | ## [v4.2.24](https://github.com/masutaka/github-nippou/compare/v4.2.23...v4.2.24) - 2024-07-02 155 | ### Maintenance :technologist: 156 | - Fix .goreleaser.yaml part5 by @masutaka in https://github.com/masutaka/github-nippou/pull/178 157 | 158 | ## [v4.2.23](https://github.com/masutaka/github-nippou/compare/v4.2.22...v4.2.23) - 2024-07-02 159 | ### Maintenance :technologist: 160 | - Fix .goreleaser.yaml part4 by @masutaka in https://github.com/masutaka/github-nippou/pull/176 161 | 162 | ## [v4.2.22](https://github.com/masutaka/github-nippou/compare/v4.2.21...v4.2.22) - 2024-07-02 163 | ### Maintenance :technologist: 164 | - Fix .goreleaser.yaml part3 by @masutaka in https://github.com/masutaka/github-nippou/pull/174 165 | 166 | ## [v4.2.21](https://github.com/masutaka/github-nippou/compare/v4.2.20...v4.2.21) - 2024-07-02 167 | ### Maintenance :technologist: 168 | - Fix .goreleaser.yaml part2 by @masutaka in https://github.com/masutaka/github-nippou/pull/172 169 | 170 | ## [v4.2.20](https://github.com/masutaka/github-nippou/compare/v4.2.19...v4.2.20) - 2024-07-02 171 | ### Maintenance :technologist: 172 | - Fix .goreleaser.yaml by @masutaka in https://github.com/masutaka/github-nippou/pull/170 173 | 174 | ## [v4.2.19](https://github.com/masutaka/github-nippou/compare/v4.2.18...v4.2.19) - 2024-07-02 175 | ### Maintenance :technologist: 176 | - switch to action hash with version comment by @masutaka in https://github.com/masutaka/github-nippou/pull/158 177 | - Change section and add label for release.yml by @masutaka in https://github.com/masutaka/github-nippou/pull/159 178 | - Introduce actionlint to CI by @masutaka in https://github.com/masutaka/github-nippou/pull/160 179 | - Fix GitHub Actions workflows by @masutaka in https://github.com/masutaka/github-nippou/pull/161 180 | - Refactor pushover workflow by @masutaka in https://github.com/masutaka/github-nippou/pull/163 181 | - Bump reviewdog/action-actionlint from 1.48.0 to 1.51.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/166 182 | - Bump goreleaser/goreleaser-action from 5 to 6 by @dependabot in https://github.com/masutaka/github-nippou/pull/167 183 | - Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/164 184 | - Bump golang.org/x/oauth2 from 0.20.0 to 0.21.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/165 185 | - Automatically update masutaka/homebrew-tap after release by @masutaka in https://github.com/masutaka/github-nippou/pull/168 186 | - Decrease GitHub App permission by @masutaka in https://github.com/masutaka/github-nippou/pull/169 187 | 188 | ## [v4.2.18](https://github.com/masutaka/github-nippou/compare/v4.2.17...v4.2.18) - 2024-06-02 189 | ### Update modules :up: 190 | - Bump golang.org/x/oauth2 from 0.19.0 to 0.20.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/156 191 | ### Other Changes 192 | - test: Does dependabot support commit hash? by @masutaka in https://github.com/masutaka/github-nippou/pull/154 193 | 194 | ## [v4.2.17](https://github.com/masutaka/github-nippou/compare/v4.2.16...v4.2.17) - 2024-05-02 195 | ### Update modules :up: 196 | - Bump golang.org/x/oauth2 from 0.18.0 to 0.19.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/153 197 | ### Other Changes 198 | - Give dependencies to the test and release workflows by @masutaka in https://github.com/masutaka/github-nippou/pull/150 199 | - Refactor GH Actions workflow by @masutaka in https://github.com/masutaka/github-nippou/pull/152 200 | 201 | ## [v4.2.16](https://github.com/masutaka/github-nippou/compare/v4.2.15...v4.2.16) - 2024-04-19 202 | ### Update modules :up: 203 | - Bump golang.org/x/net from 0.22.0 to 0.23.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/148 204 | 205 | ## [v4.2.15](https://github.com/masutaka/github-nippou/compare/v4.2.14...v4.2.15) - 2024-04-01 206 | ### Update modules :up: 207 | - Bump golang.org/x/oauth2 from 0.17.0 to 0.18.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/146 208 | 209 | ## [v4.2.14](https://github.com/masutaka/github-nippou/compare/v4.2.13...v4.2.14) - 2024-03-14 210 | ### Update modules :up: 211 | - Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/144 212 | 213 | ## [v4.2.13](https://github.com/masutaka/github-nippou/compare/v4.2.12...v4.2.13) - 2024-03-02 214 | ### Update modules :up: 215 | - Bump golang.org/x/oauth2 from 0.16.0 to 0.17.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/140 216 | - Bump google/go-github to v60 by @masutaka in https://github.com/masutaka/github-nippou/pull/143 217 | ### Other Changes 218 | - Bump go to v1.22 by @masutaka in https://github.com/masutaka/github-nippou/pull/142 219 | 220 | ## [v4.2.12](https://github.com/masutaka/github-nippou/compare/v4.2.11...v4.2.12) - 2024-02-03 221 | ### Update modules :up: 222 | - Bump actions/setup-go from 4 to 5 by @dependabot in https://github.com/masutaka/github-nippou/pull/137 223 | - Bump golang.org/x/oauth2 from 0.15.0 to 0.16.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/138 224 | 225 | ## [v4.2.11](https://github.com/masutaka/github-nippou/compare/v4.2.10...v4.2.11) - 2023-12-01 226 | ### Update modules :up: 227 | - Bump golang.org/x/oauth2 from 0.14.0 to 0.15.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/135 228 | ### Other Changes 229 | - Update badges in README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/133 230 | - Fix typo in comment by @masutaka in https://github.com/masutaka/github-nippou/pull/134 231 | 232 | ## [v4.2.10](https://github.com/masutaka/github-nippou/compare/v4.2.9...v4.2.10) - 2023-11-12 233 | ### Update modules :up: 234 | - Bump golang.org/x/oauth2 from 0.13.0 to 0.14.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/126 235 | - Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/127 236 | ### Other Changes 237 | - Introduce github-nippou-web in README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/125 238 | - Change default branch from `master` to `main` by @masutaka in https://github.com/masutaka/github-nippou/pull/128 239 | - Introduce automatic release using GitHub Actions by @masutaka in https://github.com/masutaka/github-nippou/pull/130 240 | 241 | ## [v4.2.9](https://github.com/masutaka/github-nippou/compare/v4.2.8...v4.2.9) - 2023-11-06 242 | - Bump go-github to latest v56 by @masutaka in https://github.com/masutaka/github-nippou/pull/123 243 | - Bump go-yaml to latest v3 by @masutaka in https://github.com/masutaka/github-nippou/pull/124 244 | 245 | ## [v4.2.8](https://github.com/masutaka/github-nippou/compare/v4.2.7...v4.2.8) - 2023-11-06 246 | - ライブラリとしてのユースケースに対応する by @masutaka in https://github.com/masutaka/github-nippou/pull/122 247 | 248 | ## [v4.2.7](https://github.com/masutaka/github-nippou/compare/v4.2.6...v4.2.7) - 2023-11-02 249 | - Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/120 250 | - refactor(lib): Remove environment variable dependencies from lib.List() by @MH4GF in https://github.com/masutaka/github-nippou/pull/118 251 | 252 | ## [v4.2.6](https://github.com/masutaka/github-nippou/compare/v4.2.5...v4.2.6) - 2023-10-31 253 | - maintenance: setup CI for forked PRs by @MH4GF in https://github.com/masutaka/github-nippou/pull/117 254 | - Fix broken `open-setting` sub command by @masutaka in https://github.com/masutaka/github-nippou/pull/119 255 | 256 | ## [v4.2.5](https://github.com/masutaka/github-nippou/compare/v4.2.4...v4.2.5) - 2023-10-28 257 | - docs: Add a description of the customize format by @MH4GF in https://github.com/masutaka/github-nippou/pull/115 258 | - refactor(lib): Remove environment variable dependencies from `Settings.Init()` and `Format.All()` by @MH4GF in https://github.com/masutaka/github-nippou/pull/116 259 | 260 | ## [v4.2.4](https://github.com/masutaka/github-nippou/compare/v4.2.3...v4.2.4) - 2023-10-19 261 | - maintenance: Use event.ParsePayload() instead of deprecated event.Payload() by @MH4GF in https://github.com/masutaka/github-nippou/pull/111 262 | 263 | ## [v4.2.3](https://github.com/masutaka/github-nippou/compare/v4.2.2...v4.2.3) - 2023-10-14 264 | - Bump golang.org/x/net from 0.15.0 to 0.17.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/109 265 | 266 | ## [v4.2.2](https://github.com/masutaka/github-nippou/compare/v4.2.1...v4.2.2) - 2023-10-07 267 | - Bump golang.org/x/oauth2 from 0.10.0 to 0.12.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/107 268 | - Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/masutaka/github-nippou/pull/108 269 | 270 | ## [v4.2.1](https://github.com/masutaka/github-nippou/compare/v4.2.0...v4.2.1) - 2023-09-03 271 | - Improve debug message by @masutaka 272 | 273 | ## [v4.2.0](https://github.com/masutaka/github-nippou/compare/v4.1.21...v4.2.0) - 2023-09-02 274 | - Support PullRequestReviewEvent by @tsub thx! 275 | 276 | ## [v4.1.21](https://github.com/masutaka/github-nippou/compare/v4.1.20...v4.1.21) - 2023-08-17 277 | - Fix panic on empty user input in `$ github-nippou init` by @masutaka in https://github.com/masutaka/github-nippou/pull/106 278 | 279 | ## [v4.1.20](https://github.com/masutaka/github-nippou/compare/v4.1.19...v4.1.20) - 2023-08-15 280 | - Bump go to v1.21 281 | 282 | ## [v4.1.19](https://github.com/masutaka/github-nippou/compare/v4.1.18...v4.1.19) - 2023-08-04 283 | - Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/104 284 | 285 | ## [v4.1.18](https://github.com/masutaka/github-nippou/compare/v4.1.17...v4.1.18) - 2023-07-02 286 | - Bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/103 287 | 288 | ## [v4.1.17](https://github.com/masutaka/github-nippou/compare/v4.1.16...v4.1.17) - 2023-06-02 289 | - Bump golang.org/x/oauth2 from 0.7.0 to 0.8.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/102 290 | 291 | ## [v4.1.16](https://github.com/masutaka/github-nippou/compare/v4.1.15...v4.1.16) - 2023-05-01 292 | - Bump golang.org/x/oauth2 from 0.6.0 to 0.7.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/101 293 | - Bump github.com/spf13/cobra from 1.6.1 to 1.7.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/100 294 | 295 | ## [v4.1.15](https://github.com/masutaka/github-nippou/compare/v4.1.14...v4.1.15) - 2023-04-02 296 | - Bump actions/setup-go from 3 to 4 by @dependabot in https://github.com/masutaka/github-nippou/pull/99 297 | - Bump golang.org/x/oauth2 from 0.5.0 to 0.6.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/98 298 | - Bump golang from 1.19 to 1.20 by @masutaka in 6cf73184e7457a80929d57fd1243faf5e0e7c334 299 | 300 | ## [v4.1.14](https://github.com/masutaka/github-nippou/compare/v4.1.13...v4.1.14) - 2023-03-01 301 | - Bump golang.org/x/net from 0.6.0 to 0.7.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/97 302 | 303 | ## [v4.1.13](https://github.com/masutaka/github-nippou/compare/v4.1.12...v4.1.13) - 2023-03-01 304 | - Bump golang.org/x/oauth2 from 0.0.0-20211104180415-d3ed0bb246c8 to 0.5.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/96 305 | 306 | ## [v4.1.12](https://github.com/masutaka/github-nippou/compare/v4.1.11...v4.1.12) - 2022-11-22 307 | - Support Apple silicon 308 | 309 | ## [v4.1.11](https://github.com/masutaka/github-nippou/compare/v4.1.10...v4.1.11) - 2022-11-22 310 | - Bump github.com/spf13/cobra from 1.5.0 to 1.6.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/95 311 | - It provides to add `--help` and `--version` automatic flags to the completions list 312 | 313 | ## [v4.1.10](https://github.com/masutaka/github-nippou/compare/v4.1.9...v4.1.10) - 2022-08-07 314 | - Bump github.com/spf13/cobra from 1.4.0 to 1.5.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/94 315 | - It provides the `completion` sub command for your shell completion 316 | - Bump go version from 1.18.1 to 1.18.4 75334683d8a5c4534cdf94e226a1900fb4b13e38 317 | - Avoid needlessly consuming GitHub Actions usage limits d9ba54f2886f82f466e841cd5dd4d83c3ea02755 318 | 319 | ## [v4.1.9](https://github.com/masutaka/github-nippou/compare/v4.1.8...v4.1.9) - 2022-05-21 320 | - Fix `go.mod` and `go.sum` using new make rule `bump_go_version` 321 | 322 | ## [v4.1.8](https://github.com/masutaka/github-nippou/compare/v4.1.7...v4.1.8) - 2022-05-15 323 | - Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/masutaka/github-nippou/pull/93 324 | - Bump actions/setup-go from 2 to 3 by @dependabot in https://github.com/masutaka/github-nippou/pull/92 325 | - Bump Go to 1.18 326 | - Use go install instead of go get 327 | - Use dependabot for GitHub Actions 328 | 329 | ## [v4.1.7](https://github.com/masutaka/github-nippou/compare/v4.1.6...v4.1.7) - 2022-04-03 330 | - Bump github.com/spf13/cobra from 1.3.0 to 1.4.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/91 331 | 332 | ## [v4.1.6](https://github.com/masutaka/github-nippou/compare/v4.1.5...v4.1.6) - 2022-01-01 333 | - Bump github.com/spf13/cobra from 1.2.1 to 1.3.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/90 334 | 335 | ## [v4.1.5](https://github.com/masutaka/github-nippou/compare/v4.1.4...v4.1.5) - 2021-12-30 336 | - Bump gopkg.in/yaml.v2 from 2.2.8 to 2.3.0 by @dependabot-preview in https://github.com/masutaka/github-nippou/pull/85 337 | - Update Dependabot config file by @dependabot-preview in https://github.com/masutaka/github-nippou/pull/86 338 | - Bump gopkg.in/yaml.v2 from 2.3.0 to 2.4.0 by @dependabot in https://github.com/masutaka/github-nippou/pull/87 339 | - Bump github.com/spf13/cobra from 0.0.7 to 1.2.1 by @dependabot in https://github.com/masutaka/github-nippou/pull/88 340 | - Migrate Travis CI to GitHub actions by @masutaka in https://github.com/masutaka/github-nippou/pull/89 341 | - Bump golang to 1.17.5 342 | - Drop arch 386 from release binaries 343 | 344 | ## [v4.1.4](https://github.com/masutaka/github-nippou/compare/v4.1.3...v4.1.4) - 2020-04-12 345 | - Bump github.com/rakyll/statik from 0.1.6 to 0.1.7 by @dependabot-preview in https://github.com/masutaka/github-nippou/pull/82 346 | - Bump github.com/spf13/cobra from 0.0.6 to 0.0.7 by @dependabot-preview in https://github.com/masutaka/github-nippou/pull/84 347 | - Bump golang to 1.14 348 | 349 | ## [v4.1.3](https://github.com/masutaka/github-nippou/compare/v4.1.2...v4.1.3) - 2020-02-24 350 | - Fix make dependency 351 | - Bump github.com/spf13/cobra from 0.0.5 to 0.0.6 by @dependabot-preview in https://github.com/masutaka/github-nippou/pull/81 352 | 353 | ## [v4.1.2](https://github.com/masutaka/github-nippou/compare/v4.1.1...v4.1.2) - 2020-02-03 354 | - Introduce dependabot 355 | - Bump gopkg.in/yaml.v2 from 2.2.4 to 2.2.8 by @dependabot-preview in https://github.com/masutaka/github-nippou/pull/80 356 | 357 | ## [v4.1.1](https://github.com/masutaka/github-nippou/compare/v4.1.0...v4.1.1) - 2019-10-08 358 | - Bump golang to 1.13 359 | - Update go modules 360 | - Tidy go modules 361 | 362 | ## [v4.1.0](https://github.com/masutaka/github-nippou/compare/v4.0.4...v4.1.0) - 2019-05-07 363 | - Migrate go-bindata to statik by @masutaka in https://github.com/masutaka/github-nippou/pull/76 364 | - Migrate dep to go mod by @masutaka in https://github.com/masutaka/github-nippou/pull/77 365 | 366 | ## [v4.0.4](https://github.com/masutaka/github-nippou/compare/v4.0.3...v4.0.4) - 2018-04-20 367 | - Avoid panic when user doesn't have permission to the repositories by @masutaka in https://github.com/masutaka/github-nippou/pull/75 368 | - Use event's Issue/PullRequest when user doesn't have permission to the repositories by @yono in https://github.com/masutaka/github-nippou/pull/74 369 | 370 | ## [v4.0.3](https://github.com/masutaka/github-nippou/compare/v4.0.2...v4.0.3) - 2018-02-24 371 | - Bump go version to 1.10 372 | - Update libraries using `$ dep ensure -update` 373 | 374 | ## [v4.0.2](https://github.com/masutaka/github-nippou/compare/v4.0.1...v4.0.2) - 2018-01-20 375 | - Add go version to sub command `version` 376 | - Update libraries using `$ dep ensure -update` 377 | 378 | ## [v4.0.1](https://github.com/masutaka/github-nippou/compare/v4.0.0...v4.0.1) - 2017-10-17 379 | - Fix CI by @masutaka in https://github.com/masutaka/github-nippou/pull/72 380 | - Windows by @mattn in https://github.com/masutaka/github-nippou/pull/73 381 | - Improve Makefile 382 | - Include lib/bindata.go 383 | 384 | ## [v4.0.0](https://github.com/masutaka/github-nippou/compare/v3.2.0...v4.0.0) - 2017-10-13 385 | - Introduce golang by @masutaka in https://github.com/masutaka/github-nippou/pull/70 386 | 387 | **Before:** 388 | 389 | ``` 390 | ÛÛÛÛÛ 391 | °°ÛÛÛ 392 | ÛÛÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ °ÛÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ 393 | °°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °ÛÛÛ °ÛÛÛ°°ÛÛÛ°°ÛÛÛ °ÛÛÛ 394 | °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ 395 | °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ 396 | ÛÛÛÛÛ °°ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ °°ÛÛÛÛÛÛÛ 397 | °°°°° °°°°°°°° °°°°°°°° °°°°°ÛÛÛ 398 | ÛÛÛ °ÛÛÛ 399 | °°ÛÛÛÛÛÛ 400 | °°°°°° 401 | ``` 402 | 403 | 404 | **After:** 405 | 406 | ``` 407 | 408 | ÛÛÛÛ 409 | °°ÛÛÛ 410 | ÛÛÛÛÛÛÛ ÛÛÛÛÛÛ °ÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ 411 | ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ °°°°°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ 412 | °ÛÛÛ °ÛÛÛ°ÛÛÛ °ÛÛÛ °ÛÛÛ ÛÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ 413 | °ÛÛÛ °ÛÛÛ°ÛÛÛ °ÛÛÛ °ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ 414 | °°ÛÛÛÛÛÛÛ°°ÛÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ 415 | °°°°°ÛÛÛ °°°°°° °°°°° °°°°°°°° °°°° °°°°° °°°°°ÛÛÛ 416 | ÛÛÛ °ÛÛÛ ÛÛÛ °ÛÛÛ 417 | °°ÛÛÛÛÛÛ °°ÛÛÛÛÛÛ 418 | °°°°°° °°°°°° 419 | ``` 420 | 421 | ## [v3.2.0](https://github.com/masutaka/github-nippou/compare/v3.1.0...v3.2.0) - 2017-08-19 422 | 423 | ### Feature 424 | 425 | Merge the following commands in [Setup in README.md](https://github.com/masutaka/github-nippou/blob/v3.1.0/README.md#setup) to sub command `init` by @masutaka in https://github.com/masutaka/github-nippou/pull/68 426 | 427 | $ git config --global github-nippou.user [Your GitHub account] 428 | $ git config --global github-nippou.token [Your GitHub access token] 429 | 430 | **Before:** 431 | 432 | ``` 433 | $ bundle exec bin/github-nippou init 434 | This command will create a gist and update your `~/.gitconfig`. 435 | Are you sure? [y/n] y 436 | The github-nippou settings was created on https://gist.github.com/1a1f0598a7144842881c3d0a02158b31 437 | 438 | And the gist_id was appended to your `~/.gitconfig`. You can 439 | check the gist_id with following command. 440 | 441 | $ git config --global github-nippou.settings-gist-id 442 | ``` 443 | 444 | Sub command `init` has an ability of idempotency. 445 | 446 | ``` 447 | $ bundle exec bin/github-nippou init 448 | ** Already initialized. 449 | 450 | Your `~/.gitconfig` already has gist_id as `github-nippou.settings-gist-id`. 451 | ``` 452 | 453 | **After:** 454 | 455 | `github-nippou.user` and `github-nippou.token` in ~/.gitconfig are updated by sub command `init`. 456 | 457 | 458 | ``` 459 | $ bundle exec bin/github-nippou init 460 | ** github-nippou Initialization ** 461 | 462 | == [Step: 1/3] GitHub user == 463 | 464 | What's your GitHub account? masutaka 465 | 466 | The following command will be executed. 467 | 468 | $ git config --global github-nippou.user masutaka 469 | 470 | Are you sure? [y/n] y 471 | Thanks! You can get it with the following command. 472 | 473 | $ git config --global github-nippou.user 474 | 475 | 476 | == [Step: 2/3] GitHub personal access token == 477 | 478 | To get new token with `repo` and `gist` scope, visit 479 | https://github.com/settings/tokens/new 480 | 481 | What's your GitHub personal access token? ******** 482 | 483 | The following command will be executed. 484 | 485 | $ git config --global github-nippou.token ******** 486 | 487 | Are you sure? [y/n] y 488 | Thanks! You can get it with the following command. 489 | 490 | $ git config --global github-nippou.token 491 | 492 | 493 | == [Step: 3/3] Gist (optional) == 494 | 495 | 1. Create a gist with the content of https://github.com/masutaka/github-nippou/blob/v3.1.0/config/settings.yml 496 | 2. The following command will be executed 497 | 498 | $ git config --global github-nippou.settings-gist-id 499 | 500 | Are you sure? [y/n] y 501 | Thanks! You can get it with the following command. 502 | 503 | $ git config --global github-nippou.settings-gist-id 504 | 505 | And you can easily open the gist URL with web browser. 506 | 507 | $ github-nippou open-settings 508 | 509 | ``` 510 | 511 | Sub command `init` has an ability of idempotency even after the change. 512 | 513 | ``` 514 | $ bundle exec bin/github-nippou init 515 | ** github-nippou Initialization ** 516 | 517 | == [Step: 1/3] GitHub user == 518 | 519 | Already initialized. You can get it with the following command. 520 | 521 | $ git config --global github-nippou.user 522 | 523 | 524 | == [Step: 2/3] GitHub personal access token == 525 | 526 | To get new token with `repo` and `gist` scope, visit 527 | https://github.com/settings/tokens/new 528 | 529 | Already initialized. You can get it with the following command. 530 | 531 | $ git config --global github-nippou.token 532 | 533 | 534 | == [Step: 3/3] Gist (optional) == 535 | 536 | Already initialized. You can get it with the following command. 537 | 538 | $ git config --global github-nippou.settings-gist-id 539 | 540 | And you can easily open the gist URL with web browser. 541 | 542 | $ github-nippou open-settings 543 | 544 | ``` 545 | 546 | ### Misc 547 | 548 | - Add gem `yard` for development 549 | 550 | ## [v3.1.0](https://github.com/masutaka/github-nippou/compare/v3.0.0...v3.1.0) - 2017-08-09 551 | 552 | ### Misc 553 | 554 | - Update settings.yml, which is added link to github profile 48e769337c107550ebc7264f66ed62589e272a34 555 | 556 | ## [v3.0.0](https://github.com/masutaka/github-nippou/compare/v2.0.1...v3.0.0) - 2017-08-07 557 | - Improve format by @masutaka in https://github.com/masutaka/github-nippou/pull/56 558 | - The github-nippou will be able to use custom format. by @ryz310 in https://github.com/masutaka/github-nippou/pull/58 559 | - Introduce Travis CI by @masutaka in https://github.com/masutaka/github-nippou/pull/60 560 | - Fix warnings in Ruby-2.4 by @masutaka in https://github.com/masutaka/github-nippou/pull/61 561 | - Refactor creating Github::Nippou::Settings class by @masutaka in https://github.com/masutaka/github-nippou/pull/62 562 | - Enable to inject settings_gist_id instead of the settings by @masutaka in https://github.com/masutaka/github-nippou/pull/63 563 | - Add y/n prompt to sub command `init` by @masutaka in https://github.com/masutaka/github-nippou/pull/64 564 | - Add sub command `open-settings` by @masutaka in https://github.com/masutaka/github-nippou/pull/65 565 | - Dockerize by @masutaka in https://github.com/masutaka/github-nippou/pull/66 566 | - Update README.md by @masutaka in https://github.com/masutaka/github-nippou/pull/67 567 | 568 | ### Feature 569 | 570 | #### Change output format 571 | 572 | - Before 573 | 574 | ``` 575 | * [v3.0.0 - masutaka/github-nippou](https://github.com/masutaka/github-nippou/issues/59) by masutaka 576 | * [Enable to inject settings_gist_id instead of the settings - masutaka/github-nippou](https://github.com/masutaka/github-nippou/pull/63) by masutaka **merged!** 577 | * [Add y/n prompt to sub command \`init\` - masutaka/github-nippou](https://github.com/masutaka/github-nippou/pull/64) by masutaka **merged!** 578 | * [Add sub command \`open-settings\` - masutaka/github-nippou](https://github.com/masutaka/github-nippou/pull/65) by masutaka **merged!** 579 | * [Dockerize - masutaka/github-nippou](https://github.com/masutaka/github-nippou/pull/66) by masutaka **merged!** 580 | ``` 581 | 582 | - After 583 | 584 | ``` 585 | ### masutaka/github-nippou 586 | 587 | * [v3.0.0](https://github.com/masutaka/github-nippou/issues/59) by masutaka 588 | * [Enable to inject settings_gist_id instead of the settings](https://github.com/masutaka/github-nippou/pull/63) by masutaka **merged!** 589 | * [Add y/n prompt to sub command \`init\`](https://github.com/masutaka/github-nippou/pull/64) by masutaka **merged!** 590 | * [Add sub command \`open-settings\`](https://github.com/masutaka/github-nippou/pull/65) by masutaka **merged!** 591 | * [Dockerize](https://github.com/masutaka/github-nippou/pull/66) by masutaka **merged!** 592 | ``` 593 | 594 | #### Customizable output format https://github.com/masutaka/github-nippou/pull/58 by @ryz310 595 | 596 | It should be run the new sub command `init`. 597 | 598 | ``` 599 | $ github-nippou init 600 | This command will create a gist and update your `~/.gitconfig`. 601 | Are you sure? [y/n] y 602 | The github-nippou settings was created on https://gist.github.com/ecfa35cb546d8462277d133a91b13be9 603 | 604 | And the gist_id was appended to your `~/.gitconfig`. You can 605 | check the gist_id with following command. 606 | 607 | $ git config --global github-nippou.settings-gist-id 608 | ``` 609 | 610 | It requires `gist` scope. Update your token on https://github.com/settings/tokens 611 | 612 | #### Introduce new sub command `open-settings` 613 | 614 | Open the Gist URL with your web browser 615 | 616 | ``` 617 | $ github-nippou open-settings 618 | Open https://gist.github.com/ecfa35cb546d8462277d133a91b13be9 619 | ``` 620 | 621 | #### Dockerize 622 | 623 | You can use the [dockerized github-nippou](https://hub.docker.com/r/masutaka/github-nippou/) via `bin/docker-github-nippou`. 624 | 625 | ``` 626 | $ git clone https://github.com/masutaka/github-nippou.git 627 | $ cd github-nippou/bin 628 | $ ./docker-github-nippou help 629 | ``` 630 | 631 | ### Misc 632 | 633 | - Add rspec https://github.com/masutaka/github-nippou/pull/58 by @ryz310 634 | - Introduce Travis CI 635 | - Refactoring 636 | 637 | ## [v3.0.0 beta1](https://github.com/masutaka/github-nippou/compare/v2.0.1...v3.0.0.beta1) - 2017-07-30 638 | - [Feature] customizable output format https://github.com/masutaka/github-nippou/pull/58 by @ryz310 639 | - Introduce new sub command `init` 640 | 641 | ``` 642 | $ github-nippou init 643 | => 1. Create new Gist. 644 | => 2. Add github-nippou.settings-gist-id to ~/.gitconfig 645 | ``` 646 | 647 | - It requires `gist` scope. Update your token on https://github.com/settings/tokens 648 | 649 | ## [v2.0.1](https://github.com/masutaka/github-nippou/compare/v2.0.0...v2.0.1) - 2016-04-10 650 | - Improve Authorization required message fc4fe264 651 | 652 | ## [v2.0.0](https://github.com/masutaka/github-nippou/compare/v1.2.0...v2.0.0) - 2016-04-08 653 | - Enhancements 654 | - Remove options `--all` and `--num` https://github.com/masutaka/github-nippou/pull/42 655 | - Add option `--since-date` https://github.com/masutaka/github-nippou/pull/42 656 | - Add option `--until-date` https://github.com/masutaka/github-nippou/pull/45 657 | - Add option `--debug` https://github.com/masutaka/github-nippou/pull/55 658 | - Add sub command `version` https://github.com/masutaka/github-nippou/pull/46 659 | - Improve performance https://github.com/masutaka/github-nippou/pull/44 https://github.com/masutaka/github-nippou/pull/47 https://github.com/masutaka/github-nippou/pull/51 660 | - Bugfixes 661 | - Use current title https://github.com/masutaka/github-nippou/pull/43 662 | - Fix status of issue or pull_request https://github.com/masutaka/github-nippou/pull/52 663 | - Misc 664 | - Refactoring https://github.com/masutaka/github-nippou/pull/48 https://github.com/masutaka/github-nippou/pull/49 https://github.com/masutaka/github-nippou/pull/50 https://github.com/masutaka/github-nippou/pull/53 https://github.com/masutaka/github-nippou/pull/54 665 | 666 | ## [v1.2.0](https://github.com/masutaka/github-nippou/compare/v1.1.1...v1.2.0) - 2016-03-23 667 | - Enhancements 668 | - Sort by URL https://github.com/masutaka/github-nippou/pull/40 669 | - Add status `closed` https://github.com/masutaka/github-nippou/pull/41 670 | 671 | ## [v1.1.1](https://github.com/masutaka/github-nippou/compare/v1.1.0...v1.1.1) - 2016-03-21 672 | - Enhancements 673 | - Add option `-n` https://github.com/masutaka/github-nippou/pull/39 674 | - Increase event number from 30 to 50. It is number that retrieves from GitHub 675 | 676 | ## [v1.1.0](https://github.com/masutaka/github-nippou/compare/v1.0.2...v1.1.0) - 2016-03-21 677 | - Enhancements 678 | - Add option `-a` using Thor https://github.com/masutaka/github-nippou/pull/37 679 | - Bugfixes 680 | - Escape `<` and `>` https://github.com/masutaka/github-nippou/pull/35 681 | - Misc 682 | - Refactor codes https://github.com/masutaka/github-nippou/pull/34 https://github.com/masutaka/github-nippou/pull/36 683 | - Remove fixed gem versions https://github.com/masutaka/github-nippou/pull/38 684 | 685 | ## [v1.0.2](https://github.com/masutaka/github-nippou/compare/v1.0.1...v1.0.2) - 2015-10-10 686 | 687 | ## [v1.0.1](https://github.com/masutaka/github-nippou/compare/v1.0.0...v1.0.1) - 2015-10-03 688 | 689 | ## [v1.0.0](https://github.com/masutaka/github-nippou/compare/v0.1.1...v1.0.0) - 2015-03-07 690 | 691 | ## [v0.1.1](https://github.com/masutaka/github-nippou/compare/v0.1.0...v0.1.1) - 2014-12-17 692 | 693 | ## [v0.1.0](https://github.com/masutaka/github-nippou/compare/v0.0.2...v0.1.0) - 2014-12-07 694 | 695 | ## [v0.0.2](https://github.com/masutaka/github-nippou/compare/v0.0.1...v0.0.2) - 2014-12-07 696 | 697 | ## [v0.0.1](https://github.com/masutaka/github-nippou/commits/v0.0.1) - 2014-12-07 698 | --------------------------------------------------------------------------------