Skip to content

Commit

Permalink
code clean up and removes console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
ibakshay committed May 16, 2021
1 parent 655a7dc commit c2727f2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/main.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export async function run() {
try {
core.info(`CLA Assistant GitHub Action bot has started the process`)

// using a `string` true or false purposely as github action input cannot have a boolean value
/*
* using a `string` true or false purposely as github action input cannot have a boolean value
*/
if (context.payload.action === 'closed' && input.lockPullRequestAfterMerge() == 'true') {
return lockPullRequest()
} else {
Expand Down
7 changes: 0 additions & 7 deletions src/pullrequest/pullRequestComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import signatureWithPRComment from './signatureComment'
import { commentContent } from './pullRequestCommentContent'
import {
CommitterMap,
ReactedCommitterMap,
CommittersDetails
} from '../interfaces'
import { getUseDcoFlag } from '../shared/getInputs'
Expand All @@ -13,12 +12,6 @@ import { getUseDcoFlag } from '../shared/getInputs'

export default async function prCommentSetup(committerMap: CommitterMap, committers: CommittersDetails[]) {
const signed = committerMap?.notSigned && committerMap?.notSigned.length === 0
console.log(signed)
// let signed = false

// if (committerMap?.notSigned && committerMap?.notSigned.length === 0) {
// signed = true
// }

try {
const claBotComment = await getComment()
Expand Down
12 changes: 1 addition & 11 deletions src/setupClaCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,17 @@ export async function setupClaCheck() {
core.setFailed('Please enter a personal access token as a environment variable in the CLA workflow file as described in the https://github.com/cla-assistant/github-action documentation')
return
}
// let signed: boolean = false

let committers = await getCommitters()
committers = checkAllowList(committers)

const { claFileContent, sha } = await getCLAFileContentandSHA(committers, committerMap) as ClafileContentAndSha

committerMap = prepareCommiterMap(committers, claFileContent) as CommitterMap
console.log('committerMap :>> ', committerMap)

try {
const reactedCommitters = await prCommentSetup(committerMap, committers) as ReactedCommitterMap

// if (signed) {
// core.info(`All committers have signed the CLA`)
// return reRunLastWorkFlowIfRequired()
// }
if (reactedCommitters?.newSigned.length) {
/* pushing the recently signed contributors to the CLA Json File */
await updateFile(sha, claFileContent, reactedCommitters)
Expand All @@ -44,11 +39,6 @@ export async function setupClaCheck() {
core.setFailed(`committers of Pull Request number ${context.issue.number} have to sign the CLA 📝`)
}

// if (committerMap?.notSigned === undefined || committerMap.notSigned.length === 0) {
// core.info(`All contributors have signed the CLA2`)
// return reRunLastWorkFlowIfRequired()
// }

} catch (err) {
core.setFailed(`Could not update the JSON file: ${err.message}`)
}
Expand Down

0 comments on commit c2727f2

Please sign in to comment.