use parent tree for base_tree

This commit is contained in:
Peter Evans 2024-08-23 11:32:08 +00:00
parent 02efff68da
commit 633a5a9752
2 changed files with 2 additions and 2 deletions

2
dist/index.js vendored
View file

@ -1363,7 +1363,7 @@ class GitHubHelper {
};
})));
core.info(`Creating tree for local commit ${commit.sha}`);
const { data: tree } = yield this.octokit.rest.git.createTree(Object.assign(Object.assign({}, repository), { base_tree: parentCommit.sha, tree: treeObjects }));
const { data: tree } = yield this.octokit.rest.git.createTree(Object.assign(Object.assign({}, repository), { base_tree: parentCommit.tree, tree: treeObjects }));
treeSha = tree.sha;
core.info(`Created tree ${treeSha} for local commit ${commit.sha}`);
}

View file

@ -286,7 +286,7 @@ export class GitHubHelper {
core.info(`Creating tree for local commit ${commit.sha}`)
const {data: tree} = await this.octokit.rest.git.createTree({
...repository,
base_tree: parentCommit.sha, // but this should probably be tree
base_tree: parentCommit.tree,
tree: treeObjects
})
treeSha = tree.sha