-
Notifications
You must be signed in to change notification settings - Fork 0
Host a working version #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
47ebae2
db95e8a
7e12216
d73656c
5ebea08
be514de
e1662a7
4aeefe4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,4 +96,5 @@ Thumbs.db | |
|
||
# Ignore built ts files | ||
__tests__/runner/* | ||
lib/**/* | ||
lib/**/* | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { blame } from 'git-blame-json'; | |
import * as path from 'path'; | ||
import * as core from '@actions/core'; | ||
import * as github from '@actions/github'; | ||
import * as Webhooks from '@octokit/webhooks'; | ||
//import * as Webhooks from '@octokit/webhooks'; | ||
|
||
export async function runOnBlame(files: string[]): Promise<void> { | ||
try { | ||
|
@@ -17,6 +17,9 @@ export async function runOnBlame(files: string[]): Promise<void> { | |
core.getInput('phpcs_path', { required: true }) | ||
); | ||
|
||
const dontFailOnError = | ||
core.getInput('fail_on_errors') == 'false' || | ||
core.getInput('fail_on_errors') === 'off'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really great to use double negatives in variable names, but given that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree but the original author already had this, I only intended to add a "copy" which works the same as the warning option. |
||
const dontFailOnWarning = | ||
core.getInput('fail_on_warnings') == 'false' || | ||
core.getInput('fail_on_warnings') === 'off'; | ||
|
@@ -26,8 +29,6 @@ export async function runOnBlame(files: string[]): Promise<void> { | |
} | ||
|
||
// blame files and output relevant errors | ||
const payload = github.context | ||
.payload as Webhooks.WebhookPayloadPullRequest; | ||
// get email of author of first commit in PR | ||
const authorEmail = execFileSync( | ||
'git', | ||
|
@@ -56,14 +57,15 @@ export async function runOnBlame(files: string[]): Promise<void> { | |
message.source | ||
); | ||
// fail | ||
if (message.type === 'WARNING' && !dontFailOnWarning) | ||
/*if (message.type === 'WARNING' && !dontFailOnWarning) | ||
core.setFailed(message.message); | ||
else if (message.type === 'ERROR') core.setFailed(message.message); | ||
else if (message.type === 'ERROR' && !dontFailOnError) | ||
core.setFailed(message.message);*/ | ||
} | ||
} | ||
} | ||
} catch (err) { | ||
core.debug(err); | ||
core.setFailed(err); | ||
// core.setFailed(err); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,10 @@ export function runOnCompleteFiles(files: string[]): number { | |
const standard = core.getInput('standard'); | ||
if (standard) args.push(`--standard=${standard}`); | ||
|
||
const failOnError = core.getInput('fail_on_errors'); | ||
if (failOnError == 'false' || failOnError === 'off') { | ||
args.push('--runtime-set ignore_errors_on_exit 1'); | ||
} | ||
const failOnWarning = core.getInput('fail_on_warnings'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Such consistency by the original author... |
||
if (failOnWarning == 'false' || failOnWarning === 'off') { | ||
args.push('--runtime-set ignore_warnings_on_exit 1'); | ||
|
@@ -25,7 +29,7 @@ export function runOnCompleteFiles(files: string[]): number { | |
return 0; | ||
} catch (err) { | ||
core.debug(err); | ||
core.setFailed(err); | ||
// core.setFailed(err); | ||
return 1; | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.