Skip to content

Commit 95461c0

Browse files
author
Tristan payne
committed
fix: actually assign the variable after doing the replace
1 parent b531b2f commit 95461c0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8389,9 +8389,9 @@ function createBranch(github, context, branch) {
83898389
branchExists = true;
83908390
}
83918391
catch (error) {
8392-
if (error.name === "HttpError" && error.status === 404) {
8392+
if (error.name === 'HttpError' && error.status === 404) {
83938393
// Sometimes branch might come in with refs/heads already
8394-
branch.replace("refs/heads/", "");
8394+
branch = branch.replace('refs/heads/', '');
83958395
yield toolkit.git.createRef(Object.assign({ ref: `refs/heads/${branch}`, sha: context.sha }, context.repo));
83968396
}
83978397
else {
@@ -8404,7 +8404,7 @@ exports.createBranch = createBranch;
84048404
function githubToken() {
84058405
const token = process.env.GITHUB_TOKEN;
84068406
if (!token)
8407-
throw ReferenceError("No token defined in the environment variables");
8407+
throw ReferenceError('No token defined in the environment variables');
84088408
return token;
84098409
}
84108410

src/create-branch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function createBranch(github: any, context: Context, branch: string
1515
} catch(error) {
1616
if(error.name === 'HttpError' && error.status === 404) {
1717
// Sometimes branch might come in with refs/heads already
18-
branch.replace('refs/heads/', '');
18+
branch = branch.replace('refs/heads/', '');
1919
await toolkit.git.createRef({
2020
ref: `refs/heads/${branch}`,
2121
sha: context.sha,

0 commit comments

Comments
 (0)