Skip to content

Commit

Permalink
Fix pull_request_comment.yml to update links on other authors' PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZivDero committed Sep 6, 2024
1 parent 118aee1 commit 1f00b08
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/pull_request_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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)`;
}
Expand Down

0 comments on commit 1f00b08

Please sign in to comment.