Skip to content

Commit

Permalink
Better markdown list
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Jan 4, 2022
1 parent 8aa6661 commit 705769e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ${ourSignature}`
* @param {string[]} files
*/
function pathListToMarkdown(files) {
return files.map(i => `* [\`${i}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/HEAD${i})`).join("\n");
return files.map(i => `* [\`${i}\`](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/HEAD${encodeURIComponent(i)})`).join("\n");
}

function getPayloadBody() {
Expand Down Expand Up @@ -142,7 +142,7 @@ class Actor {
if (filesWhichArentOwned.length !== 0) {
console.log(`@${sender} does not have access to \n - ${filesWhichArentOwned.join("\n - ")}\n`)
listFilesWithOwners(changedFiles, cwd)
await octokit.issues.createComment({ ...thisRepo, issue_number: issue.number, body: `Sorry @${sender}, you don't have access to these files: ${pathListToMarkdown(filesWhichArentOwned)}.` })
await octokit.issues.createComment({ ...thisRepo, issue_number: issue.number, body: `Sorry @${sender}, you don't have access to these files:\n\n${pathListToMarkdown(filesWhichArentOwned)}.` })
return
}

Expand Down

0 comments on commit 705769e

Please sign in to comment.