reverting changes to github action
Signed-off-by: Tavi Nolan <Tavi.Nolan@fmr.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user