Skip to content

Commit c80cc72

Browse files
authored
Merge pull request #1248 from capricorn86/1247-add-support-for-pr-author-to-release-notes-as-fallback-when-the-commit-author-email-doesnt-match-any-user
fix: [#1247] Adds support for PR username in release notes if it is n…
2 parents 0f0be8e + 03a79ea commit c80cc72

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.github/workflows/release.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Release
2+
23
on:
3-
push:
4-
branches:
5-
- master
4+
pull_request:
5+
types: [closed]
6+
67
jobs:
78
check-next-version:
89
runs-on: ubuntu-latest
@@ -15,10 +16,13 @@ jobs:
1516
next_version: ${{ steps.versionCheck.outputs.next_version }}
1617
current_version: ${{ steps.versionCheck.outputs.current_version }}
1718

19+
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master'
20+
1821
steps:
1922
- uses: actions/checkout@v3
2023
with:
2124
fetch-depth: 0
25+
ref: master
2226

2327
- name: Use Node.js ${{ matrix.node-version }}
2428
uses: actions/setup-node@v3
@@ -58,6 +62,7 @@ jobs:
5862
- uses: actions/checkout@v3
5963
with:
6064
fetch-depth: 0
65+
ref: master
6166

6267
- name: Use Node.js ${{ matrix.node-version }}
6368
uses: actions/setup-node@v3
@@ -131,6 +136,7 @@ jobs:
131136
- uses: actions/checkout@v3
132137
with:
133138
fetch-depth: 0
139+
ref: master
134140

135141
- name: Use Node.js ${{ matrix.node-version }}
136142
uses: actions/setup-node@v3
@@ -153,7 +159,7 @@ jobs:
153159
run: npm ci --ignore-scripts
154160

155161
- name: Generate release notes
156-
run: node ./node_modules/.bin/happy-release-notes --author=githubUsername > ./RELEASE_NOTES.md
162+
run: node ./node_modules/.bin/happy-release-notes --author=githubUsername --authorUsername=${{ github.event.pull_request.user.login }} > ./RELEASE_NOTES.md
157163

158164
- name: Create release
159165
id: create_release

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"@types/he": "^1.1.2",
1919
"@types/node": "^16.11.7",
20-
"happy-conventional-commit": "^0.0.18",
20+
"happy-conventional-commit": "^0.1.0",
2121
"chalk": "^4.1.0",
2222
"@typescript-eslint/eslint-plugin": "^6.19.0",
2323
"@typescript-eslint/parser": "^6.19.0",

0 commit comments

Comments
 (0)