Remove GHA approach for now

Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
Philipp Hugenroth
2023-02-20 12:59:18 +01:00
parent 5663de4a37
commit eaece17af0
3 changed files with 4 additions and 66 deletions
@@ -1,44 +0,0 @@
/*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import inquirer from 'inquirer';
import { adminCli } from '../../../create-github-app';
import { updateConfigFile, updateEnvFile } from '../config';
import { APP_CONFIG_FILE, ENV_CONFIG_FILE } from '../files';
// TODO(tudi2d): Wrapper for admin CLI around `create-github-app` - potentially to be removed
export const app = async (useEnvForSecrets: boolean) => {
// TODO(tudi2d): Make the GitHub Org optional
const input = await inquirer.prompt<{ org: string }>([
{
type: 'input',
name: 'org',
message: 'Enter a GitHub Org [required]',
},
]);
const { auth } = await adminCli(input.org);
// TODO(tudi2d): Also change integrations
await updateConfigFile(APP_CONFIG_FILE, { auth });
if (useEnvForSecrets) {
await updateEnvFile(
ENV_CONFIG_FILE,
auth.providers.github.development.clientId,
auth.providers.github.development.clientSecret,
);
}
};
@@ -15,7 +15,6 @@
*/
import inquirer from 'inquirer';
import { app } from './app';
import { oauth } from './oauth';
export const github = async () => {
@@ -29,26 +28,9 @@ export const github = async () => {
message:
'Would you like to store sensitive configuration details such as secrets as environment variables? (recommended)',
},
{
type: 'list',
name: 'type',
message: 'Do you want to use a Github App or Github OAuth?',
choices: ['GitHub OAuth', 'GitHub App'],
},
]);
const { type, useEnvForSecrets } = answers;
const { useEnvForSecrets } = answers;
switch (type) {
case 'GitHub OAuth': {
await oauth(useEnvForSecrets);
break;
}
case 'GitHub App': {
await app(useEnvForSecrets);
break;
}
default:
throw new Error(`Unknown selection: ${type}.`);
}
await oauth(useEnvForSecrets);
};
@@ -27,14 +27,14 @@ export async function auth(): Promise<void> {
type: 'list',
name: 'provider',
message: 'Please select a provider:',
choices: ['Github'],
choices: ['GitHub'],
},
]);
const { provider } = answers;
switch (provider) {
case 'Github': {
case 'GitHub': {
await github();
break;
}