Skip to content

Commit

Permalink
Make sure owner is defined in checkOutRemoteBranch
Browse files Browse the repository at this point in the history
  • Loading branch information
kfcampbell committed Dec 6, 2023
1 parent 61d08d0 commit 48a9801
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ async function main() {
}

core.debug(`Try to fetch and checkout remote branch "${inputs.branch}"`);
const remoteBranchExists = await checkOutRemoteBranch(inputs.branch);
const remoteBranchExists = await checkOutRemoteBranch(inputs.branch, owner, repo);

core.debug(`Pushing local changes`);
await runShellCommand(
Expand Down Expand Up @@ -950,7 +950,7 @@ async function setGitUser({ name, email }) {
await runShellCommand(`git config --global user.email '${email}'`);
}

async function checkOutRemoteBranch(branch) {
async function checkOutRemoteBranch(branch, owner, repo) {
try {
const currentBranch = await runShellCommand(
`git rev-parse --abbrev-ref HEAD`
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async function main() {
}

core.debug(`Try to fetch and checkout remote branch "${inputs.branch}"`);
const remoteBranchExists = await checkOutRemoteBranch(inputs.branch);
const remoteBranchExists = await checkOutRemoteBranch(inputs.branch, owner, repo);

core.debug(`Pushing local changes`);
await runShellCommand(
Expand Down Expand Up @@ -339,7 +339,7 @@ async function setGitUser({ name, email }) {
await runShellCommand(`git config --global user.email '${email}'`);
}

async function checkOutRemoteBranch(branch) {
async function checkOutRemoteBranch(branch, owner, repo) {
try {
const currentBranch = await runShellCommand(
`git rev-parse --abbrev-ref HEAD`
Expand Down

0 comments on commit 48a9801

Please sign in to comment.