Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(workflow): cannot trigger release action #24

Merged
merged 6 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@
# Below this line, the keys are labels to be applied, and the values are the file globs to match against.
# Anything in the `design` directory gets the `Design` label.
design:
- design/*
- changed-files:
- any-glob-to-any-file: design/*

example:
- example/*
- examples/*
- changed-files:
- any-glob-to-any-file: ["example/*", "examples/*"]

documentation:
- docs/**/*
- README.md
- changed-files:
- any-glob-to-any-file: ["docs/**/*", "README.md"]

dependencies:
- go.mod
- go.sum
- changed-files:
- any-glob-to-any-file: ["go.mod", "go.sum"]

hack:
- hack/*
- changed-files:
- any-glob-to-any-file: hack/*

unit-tests:
- "pkg/**/*_test.go"
- "cmd/**/*_test.go"
- "config/**/*_test.go"
- "internal/**/*_test.go"
- changed-files:
- any-glob-to-any-file: ["pkg/**/*_test.go", "cmd/**/*_test.go", "config/**/*_test.go", "internal/**/*_test.go"]

e2e-tests:
- "test/e2e/**/*"
- changed-files:
- any-glob-to-any-file: test/e2e/**/*
2 changes: 1 addition & 1 deletion .github/workflows/autolabel.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Auto Label"
name: "auto label"
# pull_request_target means that this will run on pull requests, but in the context of the base repo.
# This should mean PRs from forks are supported.
# Because it includes the `synchronize` parameter, any push of a new commit to the HEAD ref of a pull request
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/e2e.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
paths-ignore:
Expand All @@ -19,7 +17,7 @@ jobs:
golangci:
strategy:
matrix:
go: [ '1.20', '1.21', '1.22'' ]
go: [ '1.20', '1.21', '1.22' ]
os: [ ubuntu-latest, windows-latest ]
permissions:
contents: read # for actions/checkout to fetch code
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Release a version"

on:
tags:
- 'v*'
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
Expand Down
2 changes: 1 addition & 1 deletion cmd/cz/cz.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func New() *cobra.Command {
c := &cobra.Command{
Use: "commitizen",
Long: `Command line utility to standardize git commit messages.`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
isRepo, err := git.IsGitRepo()
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/cz/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func NewInitCmd() *cobra.Command {
c := &cobra.Command{
Use: "init",
Short: "Initialize this tool to git-core as git-cz.",
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
src, err := exec.LookPath(os.Args[0])
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/cz/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func NewVersionCmd() *cobra.Command {
c := &cobra.Command{
Use: "version",
Short: "Print the version information.",
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
fmt.Println(version.Get().String())
},
}
Expand Down
3 changes: 0 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ func load(reader io.Reader) ([]*render.Template, error) {
}
return nil, err
}
if tmpl == nil {
continue
}
templates = append(templates, tmpl)
}

Expand Down
1 change: 1 addition & 0 deletions internal/render/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"text/template"

tea "github.com/charmbracelet/bubbletea"

"github.com/shipengqi/commitizen/internal/ui"
)

Expand Down
3 changes: 1 addition & 2 deletions internal/ui/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list
type SelectModel struct {
label string
choice string
finished bool
canceled bool
err error

Expand Down Expand Up @@ -140,7 +139,7 @@ func (m *SelectModel) View() string {
"%s %s\n%s\n",
FontColor(DefaultValidateOkPrefix, colorValidateOk),
m.label,
quitValueStyle.Render(fmt.Sprintf(val)),
quitValueStyle.Render(val),
)
}
return "\n" + m.list.View()
Expand Down
3 changes: 2 additions & 1 deletion internal/ui/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ui

import (
"fmt"

"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/textarea"
Expand Down Expand Up @@ -145,7 +146,7 @@ func (m *TextAreaModel) View() string {
"%s %s\n%s\n",
FontColor(m.validateOkPrefix, colorValidateOk),
m.label,
quitValueStyle.Render(fmt.Sprintf(m.Value())),
quitValueStyle.Render(m.Value()),
)
}

Expand Down
Loading