Skip to content

Commit

Permalink
Merge pull request #267 from crs-k/fix-basic-math-failure
Browse files Browse the repository at this point in the history
fix subtraction comprehension
  • Loading branch information
crs-k authored Feb 12, 2022
2 parents fb1bf41 + 85e5444 commit 9ef63cb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/functions/create-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {daysBeforeDelete, github, owner, repo} from './get-context'

export async function createIssue(branch: string, commitAge: number): Promise<number> {
let issueId: number
const daysUntilDelete = Math.max(0, commitAge - daysBeforeDelete)
const daysUntilDelete = Math.max(0, daysBeforeDelete - commitAge)
try {
const issueResponse = await github.rest.issues.create({
owner,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/update-issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function updateIssue(
): Promise<string> {
let createdAt = ''
let commentUrl: string
const daysUntilDelete = Math.max(0, commitAge - daysBeforeDelete)
const daysUntilDelete = Math.max(0, daysBeforeDelete - commitAge)

if (commentUpdates === true) {
try {
Expand Down

0 comments on commit 9ef63cb

Please sign in to comment.