Skip to content

Commit fa4d9e5

Browse files
Copilotqoomon
andauthored
refactor: update tree progress log to show file count
Agent-Logs-Url: https://github.com/qoomon/actions--create-commit/sessions/1fdb7eb5-461d-446b-84e7-9ad4d3cc88b5 Co-authored-by: qoomon <3963394+qoomon@users.noreply.github.com>
1 parent f4e951b commit fa4d9e5

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

dist/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38243,12 +38243,10 @@ async function createCommit(octokit, repository, args) {
3824338243
console.log(`${progress} of ${args.files.length} files...`);
3824438244
})));
3824538245
const chunkSize = 100;
38246-
const chunkCount = Math.ceil(commitTreeBlobs.length / chunkSize);
3824738246
let currentBaseTree = args.parents[0];
3824838247
for (let i = 0; i < commitTreeBlobs.length; i += chunkSize) {
3824938248
const chunk = commitTreeBlobs.slice(i, i + chunkSize);
38250-
const chunkIndex = Math.floor(i / chunkSize) + 1;
38251-
console.log(`Creating commit tree chunk ${chunkIndex} of ${chunkCount}...`);
38249+
console.log(`Creating commit tree (${i + chunk.length} of ${commitTreeBlobs.length})...`);
3825238250
currentBaseTree = await octokit.rest.git.createTree({
3825338251
...repository,
3825438252
base_tree: currentBaseTree,

lib/github.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ export async function createCommit(
5858
))
5959

6060
const chunkSize = 100
61-
const chunkCount = Math.ceil(commitTreeBlobs.length / chunkSize)
6261
let currentBaseTree = args.parents[0]
6362
for (let i = 0; i < commitTreeBlobs.length; i += chunkSize) {
6463
const chunk = commitTreeBlobs.slice(i, i + chunkSize)
65-
const chunkIndex = Math.floor(i / chunkSize) + 1
66-
console.log(`Creating commit tree chunk ${chunkIndex} of ${chunkCount}...`)
64+
console.log(`Creating commit tree (${i + chunk.length} of ${commitTreeBlobs.length})...`)
6765
currentBaseTree = await octokit.rest.git.createTree({
6866
...repository,
6967
base_tree: currentBaseTree,

0 commit comments

Comments
 (0)