Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

# Azure DevOps integration for fetching commit metadata.
[remote.azure_devops]
owner = "shiftme/gitcliff"
repo = "git-cliff-readme-example"

[changelog]
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
body = """
{%- macro remote_url() -%}
https://dev.azure.com/{{ remote.azure_devops.owner }}/_git/{{ remote.azure_devops.repo }}
{%- endmacro -%}

## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
* {{ commit.message | split(pat="\n") | first | trim }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
{% if commit.remote.pr_number %} in \
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pullrequest/{{ commit.remote.pr_number }})\
{%- endif %}
{%- endfor -%}

{% if azureDevops.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
### New Contributors
{%- endif %}\
{% for contributor in azureDevops.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pullrequest/{{ contributor.pr_number }}) \
{%- endif %}
{% endfor %}\
\n\n
"""

[git]
# Parse commits according to the conventional commits specification.
# See https://www.conventionalcommits.org
conventional_commits = false
# Exclude commits that do not match the conventional commits specification.
filter_unconventional = true
# An array of regex based parsers to modify commit messages prior to further processing.
commit_preprocessors = [
# Remove issue numbers.
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e

git remote add origin https://dev.azure.com/shiftme/gitcliff/_git/git-cliff-readme-example
git pull origin master
git fetch --tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## What's Changed in v1.0.1
* refactor(parser): expose string functions by @orhun
* chore(release): add release script by @orhun

50 changes: 50 additions & 0 deletions .github/fixtures/test-azure-devops-integration/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

# Azure DevOps integration for fetching commit metadata.
[remote.azure_devops]
owner = "shiftme/gitcliff"
repo = "git-cliff-readme-example"

[changelog]
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
body = """
{%- macro remote_url() -%}
https://dev.azure.com/{{ remote.azure_devops.owner }}/_git/{{ remote.azure_devops.repo }}
{%- endmacro -%}

## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
* {{ commit.message | split(pat="\n") | first | trim }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
{% if commit.remote.pr_number %} in \
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pullrequest/{{ commit.remote.pr_number }})\
{%- endif %}
{%- endfor -%}

{% if azureDevops.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
### New Contributors
{%- endif %}\
{% for contributor in azureDevops.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pullrequest/{{ contributor.pr_number }}) \
{%- endif %}
{% endfor %}\
\n\n
"""

[git]
# Parse commits according to the conventional commits specification.
# See https://www.conventionalcommits.org
conventional_commits = false
# Exclude commits that do not match the conventional commits specification.
filter_unconventional = true
# An array of regex based parsers to modify commit messages prior to further processing.
commit_preprocessors = [
# Remove issue numbers.
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
6 changes: 6 additions & 0 deletions .github/fixtures/test-azure-devops-integration/commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e

git remote add origin https://dev.azure.com/shiftme/gitcliff/_git/git-cliff-readme-example
git pull origin master
git fetch --tags
19 changes: 19 additions & 0 deletions .github/fixtures/test-azure-devops-integration/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## What's Changed
* feat(config): support multiple file formats by @orhun
* feat(cache): use cache while fetching pages by @orhun

## What's Changed in v1.0.1
* refactor(parser): expose string functions by @orhun
* chore(release): add release script by @orhun

## What's Changed in v1.0.0
* Initial commit by @orhun
* docs(project): add README.md by @orhun
* feat(parser): add ability to parse arrays by @orhun
* fix(args): rename help argument due to conflict by @orhun
* docs(example)!: add tested usage example by @orhun

### New Contributors
* @orhun made their first contribution


Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@
"pr_labels": [],
"is_first_time": false
},
"azure_devops": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
"raw_message": "feat(web): feature 1, breaking change in footer\n\nBody feature 1\n\nBREAKING CHANGE: breaking change description feature 1\nSigned-off-by: user1 <[email protected]>\nReviewed-by: user2"
},
{
Expand Down Expand Up @@ -133,6 +140,13 @@
"pr_labels": [],
"is_first_time": false
},
"azure_devops": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
"raw_message": "feat(web)!: feature 2, breaking chain in description\n\nBody feature 2\n\nSigned-off-by: user3 <[email protected]>"
},
{
Expand Down Expand Up @@ -193,6 +207,13 @@
"pr_labels": [],
"is_first_time": false
},
"azure_devops": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
"raw_message": "feat!: feature 3, use default scope = app\n\nBody feature 2\n\nSigned-off-by: user3 <[email protected]>"
},
{
Expand Down Expand Up @@ -253,6 +274,13 @@
"pr_labels": [],
"is_first_time": false
},
"azure_devops": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
"raw_message": "fix(scope): fix 1, use scope as group\n\nBody fix 1\n\nFix: #1"
},
{
Expand Down Expand Up @@ -306,6 +334,13 @@
"pr_labels": [],
"is_first_time": false
},
"azure_devops": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
"raw_message": "fix(front-end): fix 2, no footer\n\nBody fix 2"
},
{
Expand Down Expand Up @@ -372,6 +407,13 @@
"pr_labels": [],
"is_first_time": false
},
"azure_devops": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
"raw_message": "fix(front-end): fix 3 and 4, no body but footer\n\nFix: #3\nFix: #4"
}
],
Expand Down Expand Up @@ -399,6 +441,9 @@
},
"bitbucket": {
"contributors": []
},
"azure_devops": {
"contributors": []
}
},
"repository": "/path/to/repository",
Expand All @@ -416,6 +461,9 @@
},
"bitbucket": {
"contributors": []
},
"azure_devops": {
"contributors": []
}
}
]
Loading
Loading