mirror of
https://github.com/Luzifer/git-changerelease.git
synced 2024-12-20 19:11:17 +00:00
Add logic to ignore commit messages
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
95afe2754e
commit
1a2e6ce639
4 changed files with 45 additions and 9 deletions
26
assets.go
26
assets.go
|
@ -78,12 +78,22 @@ func (fi bindataFileInfo) Sys() interface{} {
|
|||
}
|
||||
|
||||
var _bindataAssetsGitchangereleaseyaml = []byte(
|
||||
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x3c\xca\x31\x0e\x82\x40\x10\x46\xe1\x7e\x4e\x31\xd9\x7e\xf7\x00\x94\x16" +
|
||||
"\x1e\xc1\xc6\xe0\x66\x80\x9f\x75\x94\x05\x32\x43\x61\x42\xb8\xbb\x31\x51\x9b\xd7\x7c\x2f\xc6\x48\x34\xa8\x4b\x37" +
|
||||
"\x21\xbb\x96\x19\x43\xde\xa4\x78\xc3\xa3\x4c\x0e\xa2\x2a\x5b\x7f\xcf\xeb\xa7\x0d\x31\x47\x0e\xb7\xeb\x78\x6e\xf5" +
|
||||
"\x15\x7e\x56\xe5\xb1\xd8\xdf\x4e\x5d\x6b\x90\xa7\xce\x25\x10\x19\x26\x88\x23\xf7\x4b\xad\xba\xe5\x0a\x77\x29\x68" +
|
||||
"\x38\xac\x86\x55\x0c\xfc\x1d\x78\xdf\xd3\x05\xe6\xba\xcc\xc7\x11\x88\x52\x4a\xf4\x0e\x00\x00\xff\xff\x04\x87\x72" +
|
||||
"\xbd\x9a\x00\x00\x00")
|
||||
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x92\xcf\x6a\x1b\x31\x10\xc6\xef\x7a\x8a\x0f\xfb\xd2\x1e\x56\x24\x3d" +
|
||||
"\xfa\xd0\x43\x68\xe3\x53\x21\x94\xd2\x4b\x49\xcd\x78\x77\x56\xab\x56\x2b\x6d\x47\x92\x1d\x13\xf2\xee\x45\x92\x6d" +
|
||||
"\x0a\x81\xde\x72\x1b\xd0\xf7\xe7\x27\x8d\xba\xae\x53\x6a\x8d\x4f\x36\xd2\xde\x31\xb6\x0f\x5b\x44\x6b\xbc\xf5\x06" +
|
||||
"\x63\x10\x24\x32\x11\xd6\xa3\xa7\xc8\x38\x85\x8c\x21\xc0\x87\x84\x23\xf9\x84\x14\x30\xd1\x81\xab\x81\x07\xb5\x6e" +
|
||||
"\xea\x20\x17\x51\x3b\xe4\x84\xbc\xbc\x0a\x36\x36\x69\x35\xb4\xd6\x5d\x0b\xd8\x15\xfb\x06\x23\xb9\xc8\x85\xe9\xde" +
|
||||
"\xba\xc4\x82\x90\x13\xfa\x30\xcf\x36\x45\xe4\x58\xfc\x04\x61\x93\x1d\x09\xf8\x69\x11\x8e\xd1\x06\x8f\x99\x52\x3f" +
|
||||
"\x21\x78\xa4\x89\xcf\x7a\xb5\xc6\xcc\x31\x92\x61\x8d\xbb\x13\x06\x1e\x29\xbb\x84\x3d\xbb\x70\x84\x8d\xa0\x66\x62" +
|
||||
"\xa9\x44\x0f\x5f\x31\xb3\x18\x8e\x25\x64\x6b\xd3\x94\xf7\x5a\x59\xe3\x83\xf0\xee\x1c\x13\x37\x0a\xe8\xb0\xfa\xf9" +
|
||||
"\xa5\x08\xb1\x64\xe7\x20\xfc\x27\x73\x4c\xab\x42\xfc\xf9\xc0\x72\x3a\x97\x5f\xaa\x5b\x47\xc1\x0e\x9e\x11\xc6\xca" +
|
||||
"\xf7\x9a\x3f\x16\x3c\xdb\x9e\xd1\x7a\x4c\x2c\x8c\xa3\x75\x0e\x3d\xe5\xc8\x20\x2c\x25\xa6\x3b\xb0\xd4\xdb\x5a\xdf" +
|
||||
"\x0b\x97\x9d\xbc\xbb\xd5\x37\xfa\x06\xdd\x47\x94\xe1\xf6\xbd\x56\xb5\x6f\x57\xe5\x17\xdc\x1f\xe3\xfd\xa3\x7d\x7a" +
|
||||
"\x73\xc4\x99\x7e\x05\xf9\x1f\xe2\x87\x32\x5c\x11\xab\xfc\x8a\x78\xb7\x7f\x14\xa6\xdf\xd6\x9b\xca\xf9\x8d\xe7\xc5" +
|
||||
"\x51\xe2\xf2\xc9\xc6\x20\x33\xa5\x7f\x16\x7b\x05\xef\x83\x4f\x64\xeb\xa7\xaa\xa7\x13\x79\xc3\x2e\x98\xf3\xa4\xd6" +
|
||||
"\x38\x4e\xb6\x9f\x1a\xe6\x9e\x91\x23\x0f\x25\x91\x86\xa1\x1a\x12\x19\xa4\xa0\x95\xb0\x2b\xa8\xbb\x16\x7f\x59\xf7" +
|
||||
"\x06\xab\x45\x78\x21\x29\xaf\x51\x05\x78\x7e\xd6\xdf\xdb\xfd\x5e\x5e\x56\x4a\x69\xad\xd5\xdf\x00\x00\x00\xff\xff" +
|
||||
"\x8b\x01\xe7\xd6\x42\x03\x00\x00")
|
||||
|
||||
func bindataAssetsGitchangereleaseyamlBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -100,10 +110,10 @@ func bindataAssetsGitchangereleaseyaml() (*asset, error) {
|
|||
|
||||
info := bindataFileInfo{
|
||||
name: "assets/git_changerelease.yaml",
|
||||
size: 154,
|
||||
size: 834,
|
||||
md5checksum: "",
|
||||
mode: os.FileMode(436),
|
||||
modTime: time.Unix(1530601676, 0),
|
||||
modTime: time.Unix(1537952066, 0),
|
||||
}
|
||||
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
|
|
|
@ -1,13 +1,26 @@
|
|||
---
|
||||
|
||||
# Disable GPG signing for tags in case you do not want to have signed
|
||||
# tags or do not have set up GPG signing for git.
|
||||
disable_signed_tags: false
|
||||
|
||||
# Filter out commits using a regular expression match on the commit
|
||||
# message. By default below is a matcher for PR merges on Github.
|
||||
ignore_messages:
|
||||
- "^Merge pull request"
|
||||
|
||||
# Every commit message matching one of the regular expressions defined
|
||||
# in here will cause a patch-version increase (1.0.0 -> 1.0.1).
|
||||
match_patch:
|
||||
- "^[fF]ix"
|
||||
|
||||
# Every commit message matching one of the regular expressions defined
|
||||
# in here will cause a major-version increase (1.0.0 -> 2.0.0).
|
||||
match_major:
|
||||
- "^[Bb]reaking"
|
||||
|
||||
# Template to format the commit message containing the changelog change
|
||||
# which will be used to add the tag to.
|
||||
release_commit_message: "prepare release {{.Version}}"
|
||||
|
||||
...
|
||||
|
|
|
@ -12,6 +12,7 @@ type configFile struct {
|
|||
MatchMajor []string `yaml:"match_major"`
|
||||
MatchPatch []string `yaml:"match_patch"`
|
||||
ReleaseCommitMessage string `yaml:"release_commit_message"`
|
||||
IgnoreMessages []string `yaml:"ignore_messages"`
|
||||
}
|
||||
|
||||
func loadConfig() (*configFile, error) {
|
||||
|
|
12
main.go
12
main.go
|
@ -213,8 +213,20 @@ func fetchGitLogs(since string, fetchAll bool) ([]commit, error) {
|
|||
if err != nil {
|
||||
return nil, errors.New("Git used an unexpected log format")
|
||||
}
|
||||
|
||||
addLog := true
|
||||
for _, match := range config.IgnoreMessages {
|
||||
r := regexp.MustCompile(match)
|
||||
if r.MatchString(pl.Subject) {
|
||||
addLog = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if addLog {
|
||||
logs = append(logs, *pl)
|
||||
}
|
||||
}
|
||||
|
||||
return logs, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue