As default, remote upstream URL is automatically retrieved from the Git repository.If that doesn’t work or if you want to set a custom remote, there are several ways to configure it:
For each commit, Gitea-related values are added as a nested remote object:
{ "id": "8edec7fd50f703811d55f14a3c5f0fd02b43d9e7", "message": "refactor(config): remove unnecessary newline from configs\n", "group": "🚜 Refactor", "remote": { "username": "orhun", "pr_title": "some things have changed", "pr_number": 420, "pr_labels": ["rust", "enhancement"], "is_first_time": false }}
Example template:
{% 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 }}{%- endif %}{%- endfor -%}
Output:
- feat(commit): add merge_commit flag to the context by @orhun in #389- feat(args): set `CHANGELOG.md` as default missing value for output option by @sh-cho in #354
For each release, contributors data is added to the template context:
{ "version": "v1.4.0", "commits": [], "gitea": { "contributors": [ { "username": "orhun", "pr_title": "some things have changed", "pr_number": 420, "pr_labels": ["rust"], "is_first_time": true }, { "username": "cliffjumper", "pr_title": "I love jumping", "pr_number": 999, "pr_labels": ["enhancement"], "is_first_time": true } ] }}
Example template for first-time contributors:
{% for contributor in gitea.contributors | filter(attribute="is_first_time", value=true) %} * @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }}{%- endfor -%}
Output:
- @orhun made their first contribution in #420- @cliffjumper made their first contribution in #999
Gitea integration works seamlessly with Forgejo (a soft fork of Gitea):
# For Forgejo instances, use the same configurationGITEA_API_URL="https://forge.example.com" \GITEA_TOKEN="your_forgejo_token" \git cliff --gitea-repo "user/project"