Skip to content

Commit

Permalink
feat: support cross-repository branch reference (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoKish authored Sep 15, 2020
1 parent 54c29b4 commit 70d2945
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70d2945

Please sign in to comment.