Skip to content

Commit

Permalink
Bump @octokit/types from 5.5.0 to 6.1.2 (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Dec 23, 2020
1 parent 8cbb10c commit 94032e3
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

88 changes: 85 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0",
"@octokit/types": "^5.5.0",
"@octokit/types": "^6.1.2",
"globby": "^11.0.1",
"lodash": "^4.17.20"
},
Expand Down
5 changes: 4 additions & 1 deletion src/commitFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import _ from 'lodash';
import {computeBlobHashB64String} from './utils/hash';

export type Octokit = InstanceType<typeof GitHub>;
type Tree = Endpoints['POST /repos/:owner/:repo/git/trees']['parameters']['tree'];
type Tree = Endpoints['POST /repos/{owner}/{repo}/git/trees']['parameters']['tree'];

export interface CreateOrUpdateFilesParams {
owner: string;
Expand Down Expand Up @@ -35,9 +35,11 @@ export async function createOrUpdateFiles(
} catch (error) {
throw Error(`Could not get base ref ${owner}/${repo}:${ref}: ${error}`);
}
// eslint-disable-next-line @typescript-eslint/naming-convention
const {data: baseCommit} = await octokit.git.getCommit({owner, repo, commit_sha: baseRef.object.sha});
core.debug(`Base ref ${baseRef.ref} is at commit ${baseCommit.sha}`);

// eslint-disable-next-line @typescript-eslint/naming-convention
const {data: baseTree} = await octokit.git.getTree({owner, repo, tree_sha: baseCommit.tree.sha, recursive: 'true'});
core.debug(`Base tree is at ${baseTree.sha}`);

Expand Down Expand Up @@ -72,6 +74,7 @@ export async function createOrUpdateFiles(
// Create the new tree
let newTree;
try {
// eslint-disable-next-line @typescript-eslint/naming-convention
const res = await octokit.git.createTree({owner, repo, tree, base_tree: baseTree.sha});
newTree = res.data;
core.debug(`Created new tree at ${newTree.sha}`);
Expand Down

0 comments on commit 94032e3

Please sign in to comment.