reverting changes to github action

Signed-off-by: Tavi Nolan <Tavi.Nolan@fmr.com>
This commit is contained in:
Tavi Nolan
2024-04-11 11:15:39 +01:00
parent 425d9d5a43
commit 41f70d21d7
2 changed files with 0 additions and 61 deletions
@@ -2066,56 +2066,4 @@ describe('publish:github', () => {
requiredCommitSigning: false,
});
});
it('should not call createInOrg during dry run', async () => {
mockOctokit.rest.users.getByUsername.mockResolvedValue({
data: { type: 'Organization' },
});
mockOctokit.rest.teams.getByName.mockResolvedValue({
data: {
name: 'blam',
id: 42,
},
});
mockOctokit.rest.repos.createInOrg.mockResolvedValue({ data: {} });
mockContext.isDryRun = true;
await action.handler(mockContext);
expect(mockContext.output).toHaveBeenCalledWith('commitHash', 'commitHash');
expect(mockContext.output).toHaveBeenCalledWith(
'remoteUrl',
'www.example.com',
);
expect(mockContext.output).toHaveBeenCalledWith(
'repoContentsUrl',
'www.example.com/contents',
);
expect(mockOctokit.rest.repos.createInOrg).not.toHaveBeenCalled();
});
it('should not call createForAuthenticatedUser during dry run', async () => {
mockOctokit.rest.users.getByUsername.mockResolvedValue({
data: { type: 'User' },
});
mockOctokit.rest.repos.createForAuthenticatedUser.mockResolvedValue({
data: {},
});
await action.handler(mockContext);
expect(mockContext.output).toHaveBeenCalledWith('commitHash', 'commitHash');
expect(mockContext.output).toHaveBeenCalledWith(
'remoteUrl',
'www.example.com',
);
expect(mockContext.output).toHaveBeenCalledWith(
'repoContentsUrl',
'www.example.com/contents',
);
expect(
mockOctokit.rest.repos.createForAuthenticatedUser,
).not.toHaveBeenCalled();
});
});
@@ -229,15 +229,6 @@ export function createPublishGithubAction(options: {
throw new InputError('Invalid repository owner provided in repoUrl');
}
if (ctx.isDryRun) {
ctx.logger.info(`Performing dry run of creating repository`);
ctx.output('commitHash', 'commitHash');
ctx.output('remoteUrl', 'www.example.com');
ctx.output('repoContentsUrl', 'www.example.com/contents');
ctx.logger.info(`Dry run complete`);
return;
}
const newRepo = await createGithubRepoWithCollaboratorsAndTopics(
client,
repo,