Skip to content

Commit

Permalink
refactor: commit -> commitHash
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Mar 10, 2020
1 parent c97defc commit 2599ea5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/workers/branch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ export async function processBranch(
}
}

const commit = await commitFilesToBranch(config);
const commitHash = await commitFilesToBranch(config);
// TODO: Remove lockFileMaintenance rule?
if (
config.updateType === 'lockFileMaintenance' &&
Expand All @@ -433,23 +433,23 @@ export async function processBranch(
}
return 'done';
}
if (!commit && !branchExists) {
if (!commitHash && !branchExists) {
return 'no-work';
}
if (commit) {
if (commitHash) {
const action = branchExists ? 'updated' : 'created';
logger.info({ commit }, `Branch ${action}`);
logger.info({ commitHash }, `Branch ${action}`);
}
// Set branch statuses
await setStability(config);
await setUnpublishable(config);

// break if we pushed a new commit because status check are pretty sure pending but maybe not reported yet
if (
commit &&
commitHash &&
(config.requiredStatusChecks?.length || config.prCreation !== 'immediate')
) {
logger.debug({ commit }, `Branch status pending`);
logger.debug({ commitHash }, `Branch status pending`);
return 'pending';
}

Expand Down

0 comments on commit 2599ea5

Please sign in to comment.