Skip to content
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

must load env vars in function so other scripts have chance to set vars #12

Merged
merged 1 commit into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
"plugins": [
"npm",
"released"
],
"labels": {
"dependencies": {
"name": "dependencies",
"title": "Dependency Updates"
}
},
"skipReleaseLabels": [
"dependencies"
]
}
}
5 changes: 2 additions & 3 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"extends": [
"config:base"
]
"extends": ["config:base"],
"labels": ["dependencies"]
}
14 changes: 6 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import pretty from 'eslint-formatter-pretty';

import Octokit from '@octokit/rest';

const APP_ID = process.env.ESLINT_APP_ID
? Number(process.env.ESLINT_APP_ID)
: 38817;
const APP_ID = 38817;
/**
* Before you say anything I *know* this is horribly insecure.
*
Expand All @@ -21,9 +19,7 @@ const APP_ID = process.env.ESLINT_APP_ID
* metadata and read/write checks. So the attack surface is really only
* messing with a users checks, which is not too risky.
*/
const PRIVATE_KEY =
process.env.ESLINT_PRIVATE_KEY ||
`
const PRIVATE_KEY = `
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA5jyJgi6Tx5lpGj4kBJrc72ZOUd0x0ZyAWphv3cuZ7mXLH+eo
4Gg/osi/gxfu8Nznittkc155dbHsk9a2fkIfAWPGPXwloOcBLfBea+c1lp7L63Zn
Expand Down Expand Up @@ -101,8 +97,10 @@ const formatter: eslint.CLIEngine.Formatter = results => {
annotations: createAnnotations(results),
errorCount,
warningCount,
appId: APP_ID,
privateKey: PRIVATE_KEY
appId: process.env.ESLINT_APP_ID
? Number(process.env.ESLINT_APP_ID)
: APP_ID,
privateKey: process.env.ESLINT_PRIVATE_KEY || PRIVATE_KEY
});

return pretty(results);
Expand Down