From cc6a4ec83543d7342e943657eb8c730dee1a60fe Mon Sep 17 00:00:00 2001 From: Josh Wong Date: Sun, 1 Sep 2024 17:05:56 +0900 Subject: [PATCH] Add PR description link in failed workflow comment --- .github/workflows/check-checklist.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-checklist.yml b/.github/workflows/check-checklist.yml index 9c2404bc..1987b1b0 100644 --- a/.github/workflows/check-checklist.yml +++ b/.github/workflows/check-checklist.yml @@ -66,11 +66,12 @@ jobs: }); const assignee = pullRequest.assignee ? `@${pullRequest.assignee.login}` : 'No assignee'; const uncheckedItems = process.env.unchecked_items.split('\n').map(item => `- ${item}`).join('\n'); + const prLink = `https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${context.issue.number}`; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `${assignee}, not all items in the checklist have been checkedđź‘€\n\nPlease review the following unchecked items in the PR description:\n${uncheckedItems}` + body: `${assignee}, not all items in the checklist have been checkedđź‘€\n\nPlease review the unchecked items in the [PR description](${prLink})` }) - name: Fail the job if not all items are checked