Skip to content

Commit c7b7fd8

Browse files
chore(CI): Add release notes to release PRs (#374)
1 parent d0c480a commit c7b7fd8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/release-pr-template.ejs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<% if (pr.metaComment) { %>
2+
<!-- <%- JSON.stringify({ "release-pr": { v2: { crates, version } } }) %> -->
3+
<% } %>
4+
5+
This is a release PR for **<%= crate.name %>** version **<%= version.actual %>**<%
6+
if (version.actual != version.desired) {
7+
%> (performing a <%= version.desired %> bump).<%
8+
} else {
9+
%>.<%
10+
}
11+
%>

.github/workflows/pre_publish.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,21 @@ jobs:
7272

7373
- uses: chainguard-dev/actions/setup-gitsign@0cda751b114eb55c388e88f7479292668165602a # v1.0.2
7474

75-
- uses: cargo-bins/release-pr@0c019c0e5a6b9f722578d231d43ba900cacc5ffa # v2.1.3
75+
- id: pr-create
76+
uses: cargo-bins/release-pr@0c019c0e5a6b9f722578d231d43ba900cacc5ffa # v2.1.3
7677
with:
7778
github-token: ${{ secrets.GITHUB_TOKEN }}
7879
version: ${{ inputs.version != null && inputs.version || inputs.level }}
7980
crate-name: ${{ inputs.package }}
8081
git-user-name: "IOTA Foundation"
8182
git-user-email: [email protected]
8283
base-branch: develop
84+
pr-template-file: release-pr-template.md
85+
86+
- name: Add release notes
87+
run: |
88+
pr_num=$(echo "${{ steps.pr-create.outputs.pr-url }}" | sed -nr 's|.*/pull/(.*)|\1|p')
89+
body=$(gh pr view "$pr_num" --json body | jq -r '.["body"]')
90+
notes=$(git-cliff)
91+
body="$body\n# Release Notes\n\n$notes"
92+
gh pr edit $pr_num --body "$body"

0 commit comments

Comments
 (0)