Skip to content

Dependency upgrades #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Upgraded Prettier
770f9ed5831744b2616ac781a9afbe8cab66687e
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x]

env:
CI: true
Expand Down
26 changes: 13 additions & 13 deletions create-or-update-files.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const isBase64 = require("is-base64");
module.exports = function(octokit, opts) {
module.exports = function (octokit, opts) {
return new Promise(async (resolve, reject) => {
// Up front validation
try {
Expand Down Expand Up @@ -31,7 +31,7 @@ module.exports = function(octokit, opts) {
committer,
author,
changes,
batchSize
batchSize,
} = opts;

let branchAlreadyExists = true;
Expand All @@ -55,7 +55,7 @@ module.exports = function(octokit, opts) {
base = (
await octokit.rest.repos.get({
owner,
repo
repo,
})
).data.default_branch;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ module.exports = function(octokit, opts) {
if (hasFilesToDelete) {
for (const batch of chunk(change.filesToDelete, batchSize)) {
await Promise.all(
batch.map(async fileName => {
batch.map(async (fileName) => {
const exists = await fileExistsInRepo(
octokit,
owner,
Expand All @@ -115,7 +115,7 @@ module.exports = function(octokit, opts) {
path: fileName,
sha: null, // sha as null implies that the file should be deleted
mode: "100644",
type: "commit"
type: "commit",
});
}
})
Expand All @@ -125,7 +125,7 @@ module.exports = function(octokit, opts) {

for (const batch of chunk(Object.keys(change.files), batchSize)) {
await Promise.all(
batch.map(async fileName => {
batch.map(async (fileName) => {
const properties = change.files[fileName] || "";

const contents = properties.contents || properties;
Expand All @@ -148,7 +148,7 @@ module.exports = function(octokit, opts) {
path: fileName,
sha: fileSha,
mode: mode,
type: type
type: type,
});
})
);
Expand Down Expand Up @@ -200,7 +200,7 @@ module.exports = function(octokit, opts) {
repo,
force: true,
ref: `${updateRefBase}heads/${branchName}`,
sha: baseTree
sha: baseTree,
});

// Return the new branch name so that we can use it later
Expand All @@ -219,7 +219,7 @@ async function fileExistsInRepo(octokit, owner, repo, path, branch) {
owner,
repo,
path,
ref: branch
ref: branch,
});
return true;
} catch (e) {
Expand All @@ -245,7 +245,7 @@ async function createCommit(
committer,
author,
tree: tree.sha,
parents: [baseTree]
parents: [baseTree],
})
).data;
}
Expand All @@ -256,7 +256,7 @@ async function createTree(octokit, owner, repo, treeItems, baseTree) {
owner,
repo,
tree: treeItems,
base_tree: baseTree
base_tree: baseTree,
})
).data;
}
Expand All @@ -276,7 +276,7 @@ async function createBlob(octokit, owner, repo, contents, type) {
owner,
repo,
content,
encoding: "base64"
encoding: "base64",
})
).data;
return file.sha;
Expand All @@ -288,7 +288,7 @@ async function loadRef(octokit, owner, repo, ref) {
const x = await octokit.rest.git.getRef({
owner,
repo,
ref: `heads/${ref}`
ref: `heads/${ref}`,
});
return x.data.object.sha;
} catch (e) {
Expand Down
Loading