Skip to content

Commit

Permalink
Don't fail on change fail
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Castle <[email protected]>
  • Loading branch information
Kas-tle committed Apr 14, 2024
1 parent a7cd3aa commit 2d6f3d7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions cli/insertBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,19 @@ async function run() {
"project": project.value._id,
"version": version.value._id
}, {sort: {_id: -1}});
let changes = [];
const changes = [];
const lastBuild = previousBuild && previousBuild.changes.length ? previousBuild.changes.slice(0, 1)[0].commit : "HEAD^1";
const commits = gitlog({
repo: repositoryPath,
fields: ["hash", "subject", "rawBody"],
branch: lastBuild + "...HEAD"
});
const commits = [];
try {
commits = gitlog({
repo: repositoryPath,
fields: ["hash", "subject", "rawBody"],
branch: lastBuild + "...HEAD"
});
} catch (error) {
// Likely failed due to history be broken by a force push
commits = [];
}
commits.forEach(function (commit) {
changes.push({
"commit": commit.hash,
Expand Down

0 comments on commit 2d6f3d7

Please sign in to comment.