Skip to content

Commit f16ba87

Browse files
authored
fix(workflow): cannot trigger release action (#24)
* fix(workflow): cannot trigger release action * WIP(workflow): linter missing * fix(lint): lint yaml syntax error * fix(lint): lint goimport issue * fix(lint): cmd unused error * chore(labeler): rename auto label
1 parent 302cfb2 commit f16ba87

File tree

12 files changed

+26
-30
lines changed

12 files changed

+26
-30
lines changed

.github/labeler.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,29 @@
22
# Below this line, the keys are labels to be applied, and the values are the file globs to match against.
33
# Anything in the `design` directory gets the `Design` label.
44
design:
5-
- design/*
5+
- changed-files:
6+
- any-glob-to-any-file: design/*
67

78
example:
8-
- example/*
9-
- examples/*
9+
- changed-files:
10+
- any-glob-to-any-file: ["example/*", "examples/*"]
1011

1112
documentation:
12-
- docs/**/*
13-
- README.md
13+
- changed-files:
14+
- any-glob-to-any-file: ["docs/**/*", "README.md"]
1415

1516
dependencies:
16-
- go.mod
17-
- go.sum
17+
- changed-files:
18+
- any-glob-to-any-file: ["go.mod", "go.sum"]
1819

1920
hack:
20-
- hack/*
21+
- changed-files:
22+
- any-glob-to-any-file: hack/*
2123

2224
unit-tests:
23-
- "pkg/**/*_test.go"
24-
- "cmd/**/*_test.go"
25-
- "config/**/*_test.go"
26-
- "internal/**/*_test.go"
25+
- changed-files:
26+
- any-glob-to-any-file: ["pkg/**/*_test.go", "cmd/**/*_test.go", "config/**/*_test.go", "internal/**/*_test.go"]
2727

2828
e2e-tests:
29-
- "test/e2e/**/*"
29+
- changed-files:
30+
- any-glob-to-any-file: test/e2e/**/*

.github/workflows/autolabel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Auto Label"
1+
name: "auto label"
22
# pull_request_target means that this will run on pull requests, but in the context of the base repo.
33
# This should mean PRs from forks are supported.
44
# Because it includes the `synchronize` parameter, any push of a new commit to the HEAD ref of a pull request

.github/workflows/e2e.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/lint.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: golangci-lint
22
on:
33
push:
4-
tags:
5-
- v*
64
branches:
75
- main
86
paths-ignore:
@@ -19,7 +17,7 @@ jobs:
1917
golangci:
2018
strategy:
2119
matrix:
22-
go: [ '1.20', '1.21', '1.22'' ]
20+
go: [ '1.20', '1.21', '1.22' ]
2321
os: [ ubuntu-latest, windows-latest ]
2422
permissions:
2523
contents: read # for actions/checkout to fetch code

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "Release a version"
2-
32
on:
4-
tags:
5-
- 'v*'
3+
push:
4+
tags:
5+
- 'v*'
66
permissions:
77
contents: write
88
jobs:

cmd/cz/cz.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func New() *cobra.Command {
1616
c := &cobra.Command{
1717
Use: "commitizen",
1818
Long: `Command line utility to standardize git commit messages.`,
19-
RunE: func(cmd *cobra.Command, args []string) error {
19+
RunE: func(_ *cobra.Command, _ []string) error {
2020
isRepo, err := git.IsGitRepo()
2121
if err != nil {
2222
return err

cmd/cz/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func NewInitCmd() *cobra.Command {
1414
c := &cobra.Command{
1515
Use: "init",
1616
Short: "Initialize this tool to git-core as git-cz.",
17-
RunE: func(cmd *cobra.Command, args []string) error {
17+
RunE: func(_ *cobra.Command, _ []string) error {
1818
src, err := exec.LookPath(os.Args[0])
1919
if err != nil {
2020
return err

cmd/cz/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func NewVersionCmd() *cobra.Command {
1111
c := &cobra.Command{
1212
Use: "version",
1313
Short: "Print the version information.",
14-
Run: func(cmd *cobra.Command, args []string) {
14+
Run: func(_ *cobra.Command, _ []string) {
1515
fmt.Println(version.Get().String())
1616
},
1717
}

internal/config/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ func load(reader io.Reader) ([]*render.Template, error) {
138138
}
139139
return nil, err
140140
}
141-
if tmpl == nil {
142-
continue
143-
}
144141
templates = append(templates, tmpl)
145142
}
146143

internal/render/template.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"text/template"
88

99
tea "github.com/charmbracelet/bubbletea"
10+
1011
"github.com/shipengqi/commitizen/internal/ui"
1112
)
1213

0 commit comments

Comments
 (0)