Update yarn.lock (octokit/rest) (#13303)
* Update yarn.lock. * Try switching to node 20. * Increase action version. * Switch octokit to a dynamic import.
This commit is contained in:
@@ -19,12 +19,12 @@ jobs:
|
||||
runs-on: ${{ inputs.runner-env }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js 16
|
||||
uses: actions/setup-node@v3
|
||||
- name: Use Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn install ${{ inputs.yarn-args }}
|
||||
|
||||
@@ -6542,7 +6542,7 @@
|
||||
"build": "yarn prep:dts && echo [Building TypeScript code] && tsc --build tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@octokit/rest": "^20.1.1",
|
||||
"@octokit/rest": "^21.1.1",
|
||||
"@types/glob": "^7.2.0",
|
||||
"@types/mocha": "^10.0.6",
|
||||
"@types/node": "^20.14.2",
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
const fs = require("fs-extra");
|
||||
const cp = require("child_process");
|
||||
const Octokit = require('@octokit/rest')
|
||||
const path = require('path');
|
||||
const parseGitConfig = require('parse-git-config');
|
||||
|
||||
@@ -179,23 +178,21 @@ if (existingUserEmail === undefined) {
|
||||
cp.execSync(`git config --local user.email "${existingUserEmail}"`);
|
||||
}
|
||||
|
||||
console.log(`pushing to remove branch (git push -f origin ${branchName})`);
|
||||
console.log(`pushing to remote branch (git push -f origin ${branchName})`);
|
||||
cp.execSync(`git push -f origin ${branchName}`);
|
||||
|
||||
console.log("Checking if there is already a pull request...");
|
||||
const octokit = new Octokit.Octokit({auth: authToken});
|
||||
octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => {
|
||||
let alreadyHasPullRequest = false;
|
||||
if (data) {
|
||||
data.forEach((pr) => {
|
||||
alreadyHasPullRequest = alreadyHasPullRequest || (pr.title === pullRequestTitle);
|
||||
});
|
||||
}
|
||||
|
||||
(async function() {
|
||||
const { Octokit } = await import("@octokit/rest");
|
||||
const octokit = new Octokit({ auth: authToken });
|
||||
const { data } = await octokit.pulls.list({ owner: repoOwner, repo: repoName });
|
||||
let alreadyHasPullRequest = data && data.some(pr => pr.title === pullRequestTitle);
|
||||
|
||||
// If not already present, create a PR against our remote branch.
|
||||
if (!alreadyHasPullRequest) {
|
||||
console.log("There is not already a pull request. Creating one.");
|
||||
octokit.pulls.create({ body:"", owner: repoOwner, repo: repoName, title: pullRequestTitle, head: branchName, base: mergeTo });
|
||||
await octokit.pulls.create({ body:"", owner: repoOwner, repo: repoName, title: pullRequestTitle, head: branchName, base: mergeTo });
|
||||
} else {
|
||||
console.log("There is already a pull request.");
|
||||
}
|
||||
@@ -212,4 +209,4 @@ octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => {
|
||||
|
||||
console.log(`Remove localization branch (git branch -D localization)`);
|
||||
cp.execSync('git branch -D localization');
|
||||
});
|
||||
})();
|
||||
|
||||
+1662
-1397
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user