+6
@@ -17,6 +17,9 @@
|
||||
import { Git } from '@backstage/backend-common';
|
||||
import { Logger } from 'winston';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export async function initRepoAndPush({
|
||||
dir,
|
||||
remoteUrl,
|
||||
@@ -75,6 +78,9 @@ export async function initRepoAndPush({
|
||||
return { commitHash };
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export async function commitAndPushRepo({
|
||||
dir,
|
||||
auth,
|
||||
@@ -25,5 +25,5 @@ export {
|
||||
} from './executeShellCommand';
|
||||
export { fetchContents, fetchFile } from './fetch';
|
||||
export { type ActionContext, type TemplateAction } from './types';
|
||||
export { initRepoAndPush, commitAndPushRepo } from './repoHelpers';
|
||||
export { initRepoAndPush, commitAndPushRepo } from './gitHelpers';
|
||||
export { parseRepoUrl, getRepoSourceDirectory } from './util';
|
||||
|
||||
@@ -19,6 +19,9 @@ import { isChildPath } from '@backstage/backend-common';
|
||||
import { join as joinPath, normalize as normalizePath } from 'path';
|
||||
import { ScmIntegrationRegistry } from '@backstage/integration';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const getRepoSourceDirectory = (
|
||||
workspacePath: string,
|
||||
sourcePath: string | undefined,
|
||||
@@ -37,6 +40,9 @@ export const getRepoSourceDirectory = (
|
||||
return workspacePath;
|
||||
};
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const parseRepoUrl = (
|
||||
repoUrl: string,
|
||||
integrations: ScmIntegrationRegistry,
|
||||
|
||||
@@ -25,7 +25,7 @@ import { SerializedFile } from './types';
|
||||
* This method uses `resolveSafeChildPath` to make sure that files are
|
||||
* not written outside of the target directory.
|
||||
*
|
||||
* @internal
|
||||
* @public
|
||||
*/
|
||||
export async function deserializeDirectoryContents(
|
||||
targetPath: string,
|
||||
|
||||
@@ -41,6 +41,9 @@ async function asyncFilter<T>(
|
||||
return array.filter((_value, index) => filterMap[index]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export async function serializeDirectoryContents(
|
||||
sourcePath: string,
|
||||
options?: {
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export interface SerializedFile {
|
||||
path: string;
|
||||
content: Buffer;
|
||||
|
||||
Reference in New Issue
Block a user