[CI] test built

This commit is contained in:
peter-evans 2024-09-18 16:27:32 +00:00 committed by github-actions[bot]
parent 7a8aeac749
commit a3f8511408
2 changed files with 36 additions and 22 deletions

57
dist/index.js vendored
View file

@ -762,12 +762,13 @@ class GitCommandManager {
subject: detailLines[4],
body: detailLines.slice(5, endOfBodyIndex).join('\n'),
changes: lines.slice(endOfBodyIndex + 2, -1).map(line => {
const change = line.match(/^:(\d{6}) (\d{6}) \w{40} \w{40} ([AMD])\s+(.*)$/);
const change = line.match(/^:(\d{6}) (\d{6}) \w{40} (\w{40}) ([AMD])\s+(.*)$/);
if (change) {
return {
mode: change[3] === 'D' ? change[1] : change[2],
status: change[3],
path: change[4]
mode: change[4] === 'D' ? change[1] : change[2],
dstSha: change[3],
status: change[4],
path: change[5]
};
}
else {
@ -1368,25 +1369,37 @@ class GitHubHelper {
let treeSha = parentCommit.tree;
if (commit.changes.length > 0) {
core.info(`Creating tree objects for local commit ${commit.sha}`);
const treeObjects = yield Promise.all(commit.changes.map((_a) => __awaiter(this, [_a], void 0, function* ({ path, mode, status }) {
let sha = null;
if (status === 'A' || status === 'M') {
try {
const { data: blob } = yield blobCreationLimit(() => this.octokit.rest.git.createBlob(Object.assign(Object.assign({}, repository), { content: utils.readFileBase64([repoPath, path]), encoding: 'base64' })));
sha = blob.sha;
}
catch (error) {
core.error(`Error creating blob for file '${path}': ${utils.getErrorMessage(error)}`);
throw error;
}
const treeObjects = yield Promise.all(commit.changes.map((_a) => __awaiter(this, [_a], void 0, function* ({ path, mode, status, dstSha }) {
if (mode === '160000') {
// submodule
core.info(`Creating tree object for submodule commit at '${path}'`);
return {
path,
mode,
sha: dstSha,
type: 'commit'
};
}
else {
let sha = null;
if (status === 'A' || status === 'M') {
try {
const { data: blob } = yield blobCreationLimit(() => this.octokit.rest.git.createBlob(Object.assign(Object.assign({}, repository), { content: utils.readFileBase64([repoPath, path]), encoding: 'base64' })));
sha = blob.sha;
}
catch (error) {
core.error(`Error creating blob for file '${path}': ${utils.getErrorMessage(error)}`);
throw error;
}
}
core.info(`Creating tree object for blob at '${path}' with status '${status}'`);
return {
path,
mode,
sha,
type: 'blob'
};
}
core.info(`Created blob for file '${path}'`);
return {
path,
mode,
sha,
type: 'blob'
};
})));
const chunkSize = 100;
const chunkedTreeObjects = Array.from({ length: Math.ceil(treeObjects.length / chunkSize) }, (_, i) => treeObjects.slice(i * chunkSize, i * chunkSize + chunkSize));

1
report.txt Normal file
View file

@ -0,0 +1 @@
1726676851