Skip to content

Commit

Permalink
refactor: refactor changelog tool (#11)
Browse files Browse the repository at this point in the history
* refactor: refactor changelog tool
  • Loading branch information
vm-001 authored Apr 12, 2024
1 parent 667a3b2 commit 003c926
Show file tree
Hide file tree
Showing 13 changed files with 587 additions and 397 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ jobs:
go-version: '1.20'

- name: Build
run: go build -v ./...
run: make build

- name: Test
run: make test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea

cmd/changelog-markdown.tmpl
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
clean:
rm -f cmd/changelog-markdown.tmpl

generate:
go generate cmd/generate.go

install: clean generate
go install

build: clean generate
go build -v ./...

test: clean generate
go test -v ./...
4 changes: 3 additions & 1 deletion changelog-markdown.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
{{- if gt $length 0 }}
### {{ .sectionName }}
{{- range $i, $scope := .scopes }}
{{- if gt $length 0 }}
#### {{ $scope.ScopeName }}
{{- end }}
{{- range $j, $entry := $scope.Entries }}
{{ template "entry" $entry }}
{{- end }}
Expand All @@ -22,7 +24,7 @@
{{- end }}
{{- /* ==== section template ==== */ -}}

## {{ .System }}
## {{ .Title }}

{{ template "section" (dict "sectionName" "Performance" "scopes" .Type.performance) }}
{{ template "section" (dict "sectionName" "Breaking Changes" "scopes" .Type.breaking_change ) }}
Expand Down
14 changes: 14 additions & 0 deletions cmd/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cmd

import (
"net/http"
)

type LoggingTransport struct {
Transport http.RoundTripper
}

func (t *LoggingTransport) RoundTrip(request *http.Request) (*http.Response, error) {
Info("curl '%s' -H 'Authorization: %s'", request.URL, "ghp_******")
return t.Transport.RoundTrip(request)
}
Loading

0 comments on commit 003c926

Please sign in to comment.