Skip to content

Commit 879202e

Browse files
authored
Update yarn.lock (octokit/rest) (#13303)
* Update yarn.lock. * Try switching to node 20. * Increase action version. * Switch octokit to a dynamic import.
1 parent c6e6355 commit 879202e

File tree

4 files changed

+1702
-1440
lines changed

4 files changed

+1702
-1440
lines changed

Diff for: .github/workflows/job-compile-and-test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
runs-on: ${{ inputs.runner-env }}
2020

2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323

24-
- name: Use Node.js 16
25-
uses: actions/setup-node@v3
24+
- name: Use Node.js 20
25+
uses: actions/setup-node@v4
2626
with:
27-
node-version: 16
27+
node-version: 20
2828

2929
- name: Install Dependencies
3030
run: yarn install ${{ inputs.yarn-args }}

Diff for: Extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6542,7 +6542,7 @@
65426542
"build": "yarn prep:dts && echo [Building TypeScript code] && tsc --build tsconfig.json"
65436543
},
65446544
"devDependencies": {
6545-
"@octokit/rest": "^20.1.1",
6545+
"@octokit/rest": "^21.1.1",
65466546
"@types/glob": "^7.2.0",
65476547
"@types/mocha": "^10.0.6",
65486548
"@types/node": "^20.14.2",

Diff for: Extension/translations_auto_pr.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const fs = require("fs-extra");
44
const cp = require("child_process");
5-
const Octokit = require('@octokit/rest')
65
const path = require('path');
76
const parseGitConfig = require('parse-git-config');
87

@@ -179,23 +178,21 @@ if (existingUserEmail === undefined) {
179178
cp.execSync(`git config --local user.email "${existingUserEmail}"`);
180179
}
181180

182-
console.log(`pushing to remove branch (git push -f origin ${branchName})`);
181+
console.log(`pushing to remote branch (git push -f origin ${branchName})`);
183182
cp.execSync(`git push -f origin ${branchName}`);
184183

185184
console.log("Checking if there is already a pull request...");
186-
const octokit = new Octokit.Octokit({auth: authToken});
187-
octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => {
188-
let alreadyHasPullRequest = false;
189-
if (data) {
190-
data.forEach((pr) => {
191-
alreadyHasPullRequest = alreadyHasPullRequest || (pr.title === pullRequestTitle);
192-
});
193-
}
185+
186+
(async function() {
187+
const { Octokit } = await import("@octokit/rest");
188+
const octokit = new Octokit({ auth: authToken });
189+
const { data } = await octokit.pulls.list({ owner: repoOwner, repo: repoName });
190+
let alreadyHasPullRequest = data && data.some(pr => pr.title === pullRequestTitle);
194191

195192
// If not already present, create a PR against our remote branch.
196193
if (!alreadyHasPullRequest) {
197194
console.log("There is not already a pull request. Creating one.");
198-
octokit.pulls.create({ body:"", owner: repoOwner, repo: repoName, title: pullRequestTitle, head: branchName, base: mergeTo });
195+
await octokit.pulls.create({ body:"", owner: repoOwner, repo: repoName, title: pullRequestTitle, head: branchName, base: mergeTo });
199196
} else {
200197
console.log("There is already a pull request.");
201198
}
@@ -212,4 +209,4 @@ octokit.pulls.list({ owner: repoOwner, repo: repoName }).then(({data}) => {
212209

213210
console.log(`Remove localization branch (git branch -D localization)`);
214211
cp.execSync('git branch -D localization');
215-
});
212+
})();

0 commit comments

Comments
 (0)