Skip to content

Commit

Permalink
feat: added previous commit as score data property
Browse files Browse the repository at this point in the history
  • Loading branch information
KoolTheba committed Jun 3, 2023
1 parent 1e98a11 commit 7ab5913
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions __fixtures__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const scores = [
repo: 'fake-repo',
platform: 'github.com',
commit: '846b3ddb5f75d95235e94d9eb52e920f4a067338',
prevCommit: '39a08ee8b8d3818677eb823cb566f36b1b1c4671',
score: 10,
date: '2023-02-20',
currentDiff: 5
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const generateScores = async ({ scope, database: currentDatabase, maxRequestInPa
if (storedScore) {
scoreData.prevScore = storedScore.score
scoreData.prevDate = storedScore.date
scoreData.prevCommit = storedScore.commit

if (storedScore.score !== score) {
scoreData.currentDiff = parseFloat((score - storedScore.score).toFixed(1))
Expand Down

0 comments on commit 7ab5913

Please sign in to comment.