diff --git a/action.yml b/action.yml index b6e6a74..1983d87 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,9 @@ inputs: description: 'GitHub Token' required: true branch: - description: 'Branch name' + description: | + The name of the branch from which the pull request was opened. For cross-repository pull requests namespace the + branch with user or organization name, i.e. 'user:branch-name' or 'org:branch-name'. required: false base: description: 'The base branch name of the Pull Request' diff --git a/index.js b/index.js index 221eccd..4ae8956 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ const main = async () => { state: 'open' } if (branch) { - query.head = `${context.repo.owner}:${branch}` + query.head = branch.indexOf(':') === -1 ? `${context.repo.owner}:${branch}` : branch } if (base) { query.base = base