Skip to content

Commit cf7ee15

Browse files
committed
use env instead of config
1 parent cbee11e commit cf7ee15

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

functions/src/config.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,35 @@
1515
*/
1616
import * as functions from "firebase-functions/v2";
1717

18-
import * as config from "../config/config.json"
18+
import * as config from "../config/config.json";
1919
import * as log from "./log";
2020
import * as encoding from "./shared/encoding";
2121
import * as types from "./types";
2222
import * as params from "firebase-functions/params";
2323

24+
// TODO: these should be moved to cloud secrets
2425
const githubToken = params.defineString("GITHUB_TOKEN");
2526
const mailgunKey = params.defineString("MAILGUN_KEY");
27+
28+
// Not secrets
2629
const mailgunDomain = params.defineString("MAILGUN_DOMAIN");
2730
const emailDebug = params.defineBoolean("EMAIL_DEBUG");
2831
const emailGroup = params.defineString("EMAIL_GROUP");
2932

3033
export function getGitHubToken(): string {
31-
return githubToken.value()
34+
return githubToken.value();
3235
}
3336
export function getMailgunKey(): string {
34-
return mailgunKey.value()
37+
return mailgunKey.value();
3538
}
3639
export function getMailgunDomain(): string {
37-
return mailgunDomain.value()
40+
return mailgunDomain.value();
3841
}
3942
export function getEmailDebug(): boolean {
40-
return emailDebug.value()
43+
return emailDebug.value();
4144
}
4245
export function getEmailGroup(): string {
43-
return emailGroup.value()
46+
return emailGroup.value();
4447
}
4548

4649
interface Repo {

functions/src/snapshot.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import { sendPubSub } from "./pubsub";
1111
// Config
1212
const bot_config = config.BotConfig.getDefault();
1313

14-
const gh_client = new github.GitHubClient(
15-
config.getGitHubToken(),
16-
);
14+
const gh_client = new github.GitHubClient(config.getGitHubToken());
1715

1816
function cleanRepoName(name: string): string {
1917
let cleanName = name.toLowerCase();

functions/tslint.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
"linterOptions": {
3+
"exclude": [
4+
"config/*"
5+
]
6+
},
27
"rules": {
38
"class-name": true,
49
"comment-format": [

0 commit comments

Comments
 (0)