Skip to content

Commit

Permalink
use commit author for changelog attribution (#2802)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored May 21, 2024
1 parent 6a6f670 commit 61c5848
Show file tree
Hide file tree
Showing 3 changed files with 316 additions and 135 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@babel/plugin-transform-export-namespace-from": "^7.24.1",
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@changesets/cli": "^2.27.3",
"@edge-runtime/vm": "^3.2.0",
"@effect/build-utils": "^0.7.6",
"@effect/docgen": "^0.4.3",
Expand Down Expand Up @@ -75,7 +75,8 @@
},
"pnpm": {
"patchedDependencies": {
"@changesets/assemble-release-plan@6.0.0": "patches/@changesets__assemble-release-plan@6.0.0.patch"
"@changesets/assemble-release-plan@6.0.0": "patches/@changesets__assemble-release-plan@6.0.0.patch",
"@changesets/get-github-info@0.6.0": "patches/@changesets__get-github-info@0.6.0.patch"
},
"updateConfig": {
"ignoreDependencies": [
Expand Down
48 changes: 48 additions & 0 deletions patches/@changesets__get-github-info@0.6.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/dist/changesets-get-github-info.cjs.js b/dist/changesets-get-github-info.cjs.js
index a74df59f8a5988f458a3476087399f5e6dfe4818..ce5e60ef9916eb0cb76ab1e9dd422abcad752bf6 100644
--- a/dist/changesets-get-github-info.cjs.js
+++ b/dist/changesets-get-github-info.cjs.js
@@ -251,18 +251,13 @@ async function getInfo(request) {
b = new Date(b.mergedAt);
return a > b ? 1 : a < b ? -1 : 0;
})[0] : null;
-
- if (associatedPullRequest) {
- user = associatedPullRequest.author;
- }
-
return {
user: user ? user.login : null,
pull: associatedPullRequest ? associatedPullRequest.number : null,
links: {
commit: `[\`${request.commit.slice(0, 7)}\`](${data.commitUrl})`,
pull: associatedPullRequest ? `[#${associatedPullRequest.number}](${associatedPullRequest.url})` : null,
- user: user ? `[@${user.login}](${user.url})` : null
+ user: user ? `@${user.login}` : null
}
};
}
diff --git a/dist/changesets-get-github-info.esm.js b/dist/changesets-get-github-info.esm.js
index 27e5c972ab1202ff16f5124b471f4bbcc46be2b5..3940a8fe86e10cb46d8ff6436dea1103b1839927 100644
--- a/dist/changesets-get-github-info.esm.js
+++ b/dist/changesets-get-github-info.esm.js
@@ -242,18 +242,13 @@ async function getInfo(request) {
b = new Date(b.mergedAt);
return a > b ? 1 : a < b ? -1 : 0;
})[0] : null;
-
- if (associatedPullRequest) {
- user = associatedPullRequest.author;
- }
-
return {
user: user ? user.login : null,
pull: associatedPullRequest ? associatedPullRequest.number : null,
links: {
commit: `[\`${request.commit.slice(0, 7)}\`](${data.commitUrl})`,
pull: associatedPullRequest ? `[#${associatedPullRequest.number}](${associatedPullRequest.url})` : null,
- user: user ? `[@${user.login}](${user.url})` : null
+ user: user ? `@${user.login}` : null
}
};
}
Loading

0 comments on commit 61c5848

Please sign in to comment.