Skip to content

Commit 6ade978

Browse files
committedMar 24, 2023
fix(typescript): scope probot context passed to handlers in probot-kubernetes
Signed-off-by: Tomas Coufal <tcoufal@redhat.com>

File tree

2 files changed

+8
-298
lines changed

2 files changed

+8
-298
lines changed
 

‎packages/probot-issue-form/parser.test.ts

-293
This file was deleted.

‎packages/probot-kubernetes/index.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs';
22
import * as k8s from '@kubernetes/client-node';
33
import { InstallationAccessTokenAuthentication } from '@octokit/auth-app';
44
import dotenv from 'dotenv';
5-
import { Probot } from 'probot';
5+
import { Probot, Context } from 'probot';
66

77
if (process.env.NODE_ENV !== 'production') {
88
dotenv.config();
@@ -35,11 +35,14 @@ export const getNamespace = () => k8sNamespace;
3535
export const APIS = k8s;
3636

3737
export const useK8sTokenStore = (app: Probot) => {
38-
app.on('installation.created', async (context) => {
39-
await createTokenSecret(context);
40-
});
38+
app.on(
39+
'installation.created',
40+
async (context: Context<'installation.created'>) => {
41+
await createTokenSecret(context);
42+
}
43+
);
4144

42-
app.on('installation.deleted', async (context) => {
45+
app.on('installation.deleted', async (context: Context<'installation.deleted'>) => {
4346
await deleteTokenSecret(context);
4447
});
4548

0 commit comments

Comments
 (0)