Skip to content

Commit 6077a81

Browse files
Merge pull request #25 from aka-tpayne/master
Remove refs/heads from incoming branch variable
2 parents e4b87d8 + 960c611 commit 6077a81

File tree

5 files changed

+6838
-6758
lines changed

5 files changed

+6838
-6758
lines changed

__tests__/create-branch.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ describe('Create a branch based on the input', () => {
5555
})
5656
});
5757

58+
it('Replaces refs/heads in branch name', async () => {
59+
octokitMock.repos.getBranch.mockRejectedValue(new HttpError())
60+
await createBranch(githubMock, contextMock, `refs/heads/${branch}`)
61+
expect(octokitMock.git.createRef).toHaveBeenCalledWith({
62+
ref: 'refs/heads/release-v1',
63+
sha: 'ebb4992dc72451c1c6c99e1cce9d741ec0b5b7d7'
64+
})
65+
});
66+
5867
it('fails if github token isn\'t defined', async() => {
5968
delete process.env.GITHUB_TOKEN
6069
expect.assertions(1);

0 commit comments

Comments
 (0)