From 1f00b086abc2a925f31018943e8ebc1e5ec3c64e Mon Sep 17 00:00:00 2001 From: Kirill Andriiashin Date: Fri, 6 Sep 2024 23:04:02 +0300 Subject: [PATCH] Fix pull_request_comment.yml to update links on other authors' PRs --- .github/workflows/pull_request_comment.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull_request_comment.yml b/.github/workflows/pull_request_comment.yml index 1da222437..db7ecebba 100644 --- a/.github/workflows/pull_request_comment.yml +++ b/.github/workflows/pull_request_comment.yml @@ -24,13 +24,12 @@ jobs: const {owner, repo} = context.repo; const run_id = ${{github.event.workflow_run.id}}; const pull_head_sha = '${{github.event.workflow_run.head_sha}}'; - const pull_user_id = ${{github.event.sender.id}}; const issue_number = await (async () => { const pulls = await github.pulls.list({owner, repo}); for await (const {data} of github.paginate.iterator(pulls)) { for (const pull of data) { - if (pull.head.sha === pull_head_sha && pull.user.id === pull_user_id) { + if (pull.head.sha === pull_head_sha) { return pull.number; } } @@ -46,7 +45,7 @@ jobs: if (!artifacts.length) { return core.error(`No artifacts found`); } - let body = `This comment is automaticly generated by [Nightly.link](https://nightly.link/) and allows non-registered users to get download the artifacts for this pull request.\n\nThese links are also updated when the pull request is pushed to.\n`; + let body = `This comment is automatically generated by [Nightly.link](https://nightly.link/) and allows non-registered users to get download the artifacts for this pull request.\n\nThese links are also updated when the pull request is pushed to.\n`; for (const art of artifacts) { body += `\n* [${art.name}.zip](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; }