From f322266647154edf458eb45222004d7fdd1ddb9c Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Wed, 28 Feb 2024 16:36:14 -0500 Subject: [PATCH] Fix await inside non-async function --- .github/workflows/publish.yml | 12 +++++++++--- .github/workflows/release.yml | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ca0cd35a0..318f6ffcc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -98,11 +98,17 @@ jobs: head: "${{ github.ref }}" }); - const pullRequests = commits.map((commit) => { + const pullRequests = []; + + for (const commit of commits) { const { data: response } = await octokit.request(`GET /repos/shopify/ruby-lsp/commits/${commit.sha}/pulls`); - { title: response.title, url: response.html_url, labels: response.labels.map((label) => label.name) } - }); + pullRequests.push({ + title: response.title, + url: response.html_url, + labels: response.labels.map((label) => label.name) + }); + } const relevantPulls = pullRequests.filter((pull) => { return pull.labels.some((label) => label === "vscode") && diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d47d58614..9dd6fe05d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,11 +32,17 @@ jobs: head: "${{ github.ref }}" }); - const pullRequests = commits.map((commit) => { + const pullRequests = []; + + for (const commit of commits) { const { data: response } = await octokit.request(`GET /repos/shopify/ruby-lsp/commits/${commit.sha}/pulls`); - { title: response.title, url: response.html_url, labels: response.labels.map((label) => label.name) } - }); + pullRequests.push({ + title: response.title, + url: response.html_url, + labels: response.labels.map((label) => label.name) + }); + } const relevantPulls = pullRequests.filter((pull) => { return pull.labels.some((label) => label === "server") &&