console/deployment/services/github.ts
2024-03-04 13:56:12 +01:00

22 lines
640 B
TypeScript

import { Config, Output } from '@pulumi/pulumi';
import { ServiceSecret } from '../utils/secrets';
class GitHubIntegrationSecret extends ServiceSecret<{
appId: string | Output<string>;
privateKey: string | Output<string>;
}> {}
export function configureGithubApp() {
const githubAppConfig = new Config('ghapp');
const githubSecret = new GitHubIntegrationSecret('gitub-app', {
appId: githubAppConfig.require('id'),
privateKey: githubAppConfig.requireSecret('key'),
});
return {
name: githubAppConfig.require('name'),
secret: githubSecret,
};
}
export type GitHubApp = ReturnType<typeof configureGithubApp>;