Skip to content

Commit 8972545

Browse files
committed
fix: update
1 parent 1c54d0a commit 8972545

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ For repositories with many packages, comments might get too long. In that case,
233233

234234
pkg.pr.new uses `npm pack --json` under the hood, in case you face issues, you can also use the `--pnpm`, `--yarn`, or `--bun` flag so it starts using `pnpm pack`, `yarn pack`, or `bun pm pack`. This is not necessary in most cases.
235235

236+
If you want to add comments to the associated issue simultaneously, you can set `--syncCommentWithIssue`.
237+
236238
<img width="100%" src="https://github.com/stackblitz-labs/pkg.pr.new/assets/37929992/2fc03b94-ebae-4c47-a271-03a4ad5d2449" />
237239

238240
pkg.pr.new is not available in your local environment and it only works in workflows.

packages/app/server/routes/publish.post.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ export default eventHandler(async (event) => {
251251
let prevComment:
252252
| OctokitComponents["schemas"]["issue-comment"]
253253
| undefined;
254-
let prevIssueComments: OctokitComponents["schemas"]["issue-comment"][] =
254+
const prevIssueComments: OctokitComponents["schemas"]["issue-comment"][] =
255255
[];
256-
let relatedIssueNumbers: number[] = [];
256+
const relatedIssueNumbers: number[] = [];
257257
const matchIssueNumber = /(fix(es)?|closes?|resolves?)\s*(\d+)/gi;
258258
const fullAddressMatchIssueNumber = new RegExp(
259259
`(fix(es)|closes?|resolves?)\\s*https://github.com/${workflowData.owner}/${workflowData.repo}/issues/(\\d+)`,
@@ -310,7 +310,6 @@ export default eventHandler(async (event) => {
310310
);
311311

312312
if (syncCommentWithIssue && relatedIssueNumbers.length) {
313-
prevIssueComments = [];
314313
for (const issueNumber of relatedIssueNumbers) {
315314
await installation.paginate(
316315
"GET /repos/{owner}/{repo}/issues/{issue_number}/comments",

0 commit comments

Comments
 (0)