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
|
||||
}
|
||||
});
|
||||
let repoOwner = process.env.GITHUB_REPOSITORY.split('/')[0];
|
||||
if (inputs.pushToFork) {
|
||||
const forkName = yield githubHelper.getRepositoryParent(baseRemote.repository);
|
||||
if (!forkName) {
|
||||
repoOwner = forkName;
|
||||
}
|
||||
}
|
||||
const repoName = process.env.GITHUB_REPOSITORY.split('/')[1];
|
||||
// let repoOwner = process.env.GITHUB_REPOSITORY!.split('/')[0]
|
||||
// if (inputs.pushToFork) {
|
||||
// const forkName = await githubHelper.getRepositoryParent(
|
||||
// baseRemote.repository
|
||||
// )
|
||||
// if (!forkName) {
|
||||
// repoOwner = forkName!
|
||||
// }
|
||||
// }
|
||||
// const repoName = process.env.GITHUB_REPOSITORY!.split('/')[1]
|
||||
const [repoOwner, repoName] = branchRepository.split('/');
|
||||
core.debug(`repoOwner: '${repoOwner}', repoName: '${repoName}'`);
|
||||
const refQuery = `
|
||||
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]
|
||||
if (inputs.pushToFork) {
|
||||
const forkName = await githubHelper.getRepositoryParent(
|
||||
baseRemote.repository
|
||||
)
|
||||
if (!forkName) {
|
||||
repoOwner = forkName!
|
||||
}
|
||||
}
|
||||
const repoName = process.env.GITHUB_REPOSITORY!.split('/')[1]
|
||||
// let repoOwner = process.env.GITHUB_REPOSITORY!.split('/')[0]
|
||||
// if (inputs.pushToFork) {
|
||||
// const forkName = await githubHelper.getRepositoryParent(
|
||||
// baseRemote.repository
|
||||
// )
|
||||
// if (!forkName) {
|
||||
// repoOwner = forkName!
|
||||
// }
|
||||
// }
|
||||
// const repoName = process.env.GITHUB_REPOSITORY!.split('/')[1]
|
||||
const [repoOwner, repoName] = branchRepository.split('/')
|
||||
|
||||
core.debug(`repoOwner: '${repoOwner}', repoName: '${repoName}'`)
|
||||
const refQuery = `
|
||||
|
|
Loading…
Reference in a new issue