try to fix head repo
This commit is contained in:
parent
404696dda5
commit
03266d3789
2 changed files with 22 additions and 18 deletions
19
dist/index.js
vendored
19
dist/index.js
vendored
|
@ -455,14 +455,17 @@ function createPullRequest(inputs) {
|
||||||
authorization: 'token ' + inputs.token
|
authorization: 'token ' + inputs.token
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let repoOwner = process.env.GITHUB_REPOSITORY.split('/')[0];
|
// let repoOwner = process.env.GITHUB_REPOSITORY!.split('/')[0]
|
||||||
if (inputs.pushToFork) {
|
// if (inputs.pushToFork) {
|
||||||
const forkName = yield githubHelper.getRepositoryParent(baseRemote.repository);
|
// const forkName = await githubHelper.getRepositoryParent(
|
||||||
if (!forkName) {
|
// baseRemote.repository
|
||||||
repoOwner = forkName;
|
// )
|
||||||
}
|
// if (!forkName) {
|
||||||
}
|
// repoOwner = forkName!
|
||||||
const repoName = process.env.GITHUB_REPOSITORY.split('/')[1];
|
// }
|
||||||
|
// }
|
||||||
|
// const repoName = process.env.GITHUB_REPOSITORY!.split('/')[1]
|
||||||
|
const [repoOwner, repoName] = branchRepository.split('/');
|
||||||
core.debug(`repoOwner: '${repoOwner}', repoName: '${repoName}'`);
|
core.debug(`repoOwner: '${repoOwner}', repoName: '${repoName}'`);
|
||||||
const refQuery = `
|
const refQuery = `
|
||||||
query GetRefId($repoName: String!, $repoOwner: String!, $branchName: String!) {
|
query GetRefId($repoName: String!, $repoOwner: String!, $branchName: String!) {
|
||||||
|
|
|
@ -210,16 +210,17 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let repoOwner = process.env.GITHUB_REPOSITORY!.split('/')[0]
|
// let repoOwner = process.env.GITHUB_REPOSITORY!.split('/')[0]
|
||||||
if (inputs.pushToFork) {
|
// if (inputs.pushToFork) {
|
||||||
const forkName = await githubHelper.getRepositoryParent(
|
// const forkName = await githubHelper.getRepositoryParent(
|
||||||
baseRemote.repository
|
// baseRemote.repository
|
||||||
)
|
// )
|
||||||
if (!forkName) {
|
// if (!forkName) {
|
||||||
repoOwner = forkName!
|
// repoOwner = forkName!
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
const repoName = process.env.GITHUB_REPOSITORY!.split('/')[1]
|
// const repoName = process.env.GITHUB_REPOSITORY!.split('/')[1]
|
||||||
|
const [repoOwner, repoName] = branchRepository.split('/')
|
||||||
|
|
||||||
core.debug(`repoOwner: '${repoOwner}', repoName: '${repoName}'`)
|
core.debug(`repoOwner: '${repoOwner}', repoName: '${repoName}'`)
|
||||||
const refQuery = `
|
const refQuery = `
|
||||||
|
|
Loading…
Reference in a new issue