Skip to content

Instantly share code, notes, and snippets.

@isuke
Last active February 9, 2023 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isuke/03d83037f13a671d0f0a0af5d76496f8 to your computer and use it in GitHub Desktop.
Save isuke/03d83037f13a671d0f0a0af5d76496f8 to your computer and use it in GitHub Desktop.
git-consistent sample 04 issue link by branch name
type:
type: enum
required: true
description: 'commit type'
values:
-
name: feat
description: 'when implementing function'
-
name: fix
description: 'when fixing a bug'
-
name: refactor
description: 'when refactoring'
-
name: docs
description: 'when writing docs'
-
name: test
description: 'when adding tests'
-
name: chore
description: "when change other that don't modify code or test files"
-
name: remove
description: 'when removing function'
-
name: perf
description: 'when improving performance'
-
name: ci
description: 'when fixing the CI build'
-
name: sec
description: 'when dealing with security'
-
name: up
description: 'when upgrading dependencies'
-
name: down
description: 'when downgrading dependencies'
-
name: tada
description: 'when celebrating'
-
name: revert
description: 'when reverts a previous commit'
subject:
type: string
required: true
description: 'The subject contains succinct description of the change'
rules:
firstLetter: lower
dotAtEnd: false
ascii: false
issueLink:
type: branch
required: false
description: 'Github issue link'
regExp: 'issue([0-9]+)'
prefix: 'https://github.com/you/repository/issues/'
suffix: "\n"
body:
type: text
default: ''
required: false
description: 'The body contains details of the change'
rules:
firstLetter: upper
dotAtEnd: true
nonAscii: false
<type> <subject>
<issueLink><body>

This is git-consistent sample.

example commmits

if current branch name is 'issue123_foobar'.
feat: implement hoge

https://github.com/you/repository/issues/123
This is amazing commit.
feat: implement hoge

https://github.com/you/repository/issues/123
if current branch name is 'foobar'.
feat: implement hoge

This is amazing commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment