From 5fe2a84a641c9af81690caa1b6ad3d5d9ab42e62 Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Wed, 24 Jul 2024 12:18:41 -0500 Subject: [PATCH] fix 'change file add' URL on forks --- .changes/action-supports-dry-run.md | 2 +- .changes/change-file-add-url-on-forks.md | 5 +++++ .changes/change-pr-350.md | 4 ++-- packages/action/src/comment/formatGithubComment.ts | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changes/change-file-add-url-on-forks.md diff --git a/.changes/action-supports-dry-run.md b/.changes/action-supports-dry-run.md index 816f457e..944e33c2 100644 --- a/.changes/action-supports-dry-run.md +++ b/.changes/action-supports-dry-run.md @@ -1,5 +1,5 @@ --- -"action": patch:bug +"action": patch:enhance --- The action now supports running in dry run mode. This enables testing of workflows and publish sequences prior to publishing. diff --git a/.changes/change-file-add-url-on-forks.md b/.changes/change-file-add-url-on-forks.md new file mode 100644 index 00000000..7e2aa4e9 --- /dev/null +++ b/.changes/change-file-add-url-on-forks.md @@ -0,0 +1,5 @@ +--- +"action": patch:bug +--- + +The URL to create a change file on forks was broken. It was incorrectly pointing at the root repo. diff --git a/.changes/change-pr-350.md b/.changes/change-pr-350.md index cd5d5df9..030ab383 100644 --- a/.changes/change-pr-350.md +++ b/.changes/change-pr-350.md @@ -1,6 +1,6 @@ --- -"covector": patch -"action": patch +"covector": patch:bug +"action": patch:bug --- Fix GitHub pull request comment link to correctly point at the docs. diff --git a/packages/action/src/comment/formatGithubComment.ts b/packages/action/src/comment/formatGithubComment.ts index c0f7afc9..0f6d12b4 100644 --- a/packages/action/src/comment/formatGithubComment.ts +++ b/packages/action/src/comment/formatGithubComment.ts @@ -13,7 +13,7 @@ export function formatComment({ changeFolder: string; }) { let comment = `### Package Changes Through ${payload.pull_request.head.sha}\n`; - let addChangeFileUrl = `${payload.pull_request.html_url}/../../new/${ + let addChangeFileUrl = `${payload.pull_request.head.repo.html_url}/../../new/${ payload.pull_request.head.ref }${newChangeFile({ prNumber: payload.pull_request.number,