mirror of
https://github.com/changesets/action
synced 2026-10-26 16:39:56 +08:00
Do not pre-start github API request (#467)
* Do not pre-start github API request * Create quiet-jeans-poke.md --------- Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This commit is contained in:
co-authored by
Mateusz Burzyński
parent
5f15b43b42
commit
6e575506e6
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@changesets/action": patch
|
||||
---
|
||||
|
||||
Avoid searching for an existing pull request early.
|
||||
+6
-7
@@ -300,12 +300,6 @@ export async function runVersion({
|
||||
});
|
||||
}
|
||||
|
||||
const existingPullRequestsPromise = octokit.rest.pulls.list({
|
||||
...github.context.repo,
|
||||
state: "open",
|
||||
head: `${github.context.repo.owner}:${versionBranch}`,
|
||||
base: branch,
|
||||
});
|
||||
let changedPackages = await getChangedPackages(cwd, versionsByDirectory);
|
||||
let changedPackagesInfoPromises = Promise.all(
|
||||
changedPackages.map(async (pkg) => {
|
||||
@@ -331,7 +325,12 @@ export async function runVersion({
|
||||
|
||||
await git.pushChanges({ branch: versionBranch, message: finalCommitMessage });
|
||||
|
||||
let existingPullRequests = await existingPullRequestsPromise;
|
||||
let existingPullRequests = await octokit.rest.pulls.list({
|
||||
...github.context.repo,
|
||||
state: "open",
|
||||
head: `${github.context.repo.owner}:${versionBranch}`,
|
||||
base: branch,
|
||||
});
|
||||
core.info(JSON.stringify(existingPullRequests.data, null, 2));
|
||||
|
||||
const changedPackagesInfo = (await changedPackagesInfoPromises)
|
||||
|
||||
Reference in New Issue
Block a user