Skip to content

Commit 581bfcf

Browse files
committed
ci: fixed release notes
git-cliff does not seem to extract automatically the tag message on CI (works on local, though...). Added a step to extract the tag message and pass it to git-cliff explicitly. Signed-off-by: Frederic BIDON <[email protected]>
1 parent be76d48 commit 581bfcf

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.cliff.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ body = """
7878
### People who contributed to this release
7979
{% endif %}
8080
{%- for contributor in github.contributors | filter(attribute="username") | sort(attribute="username") %}
81-
{%- if contributor.username != "dependabot[bot]" %}
81+
{%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %}
8282
* [@{{ contributor.username }}](https://github.com/{{ contributor.username }})
8383
{%- endif %}
8484
{%- endfor %}
@@ -91,7 +91,7 @@ body = """
9191
{%- endif %}
9292
9393
{%- for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
94-
{%- if contributor.username != "dependabot[bot]" %}
94+
{%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %}
9595
* @{{ contributor.username }} made their first contribution
9696
{%- if contributor.pr_number %}
9797
in [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ jobs:
2525
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626
with:
2727
fetch-depth: 0
28+
-
29+
name: Extract tag message
30+
id: get_message
31+
# git-cliff may or may not pick the current tag message, difficult to tell when
32+
# this works. We extract the tag message explicitly.
33+
run: |
34+
MESSAGE=$(git tag -l '${{ github.ref_name }}' --format='%(contents:subject)
35+
36+
%(contents:body)
37+
')
38+
export MESSAGE
39+
echo "message<<EOF" >> "${GITHUB_OUTPUT}"
40+
printenv MESSAGE >> "${GITHUB_OUTPUT}"
41+
echo 'EOF' >> "${GITHUB_OUTPUT}"
2842
-
2943
name: Generate release notes
3044
id: notes
@@ -36,6 +50,7 @@ jobs:
3650
config: '.cliff.toml'
3751
args: >-
3852
--current
53+
--with-tag-message '${{ steps.get_message.outputs.message }}'
3954
-
4055
name: Create github release
4156
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2

0 commit comments

Comments
 (0)