diff --git a/README.md b/README.md index e14db1b..9d53145 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,8 @@ title | `String` | **true** body | `String` | **true** locked | `Boolean` | **true** | Accepts `true`, `false` or `'true'`, `'false'` milestone | `Integer` | **true** -head | `String` | false +head | `String` | false | Revision (SHA) of the head commit of this pull request +headRef | `String` | false | Name of the branch this pull request is created for base | `String` | **true** | Name of the base branch in the current repository this pull request targets files | `Iterable` | false assignees | `List` | **true** | Accepts a `List` diff --git a/src/main/java/org/jenkinsci/plugins/pipeline/github/PullRequestGroovyObject.java b/src/main/java/org/jenkinsci/plugins/pipeline/github/PullRequestGroovyObject.java index 6195819..7859550 100644 --- a/src/main/java/org/jenkinsci/plugins/pipeline/github/PullRequestGroovyObject.java +++ b/src/main/java/org/jenkinsci/plugins/pipeline/github/PullRequestGroovyObject.java @@ -142,6 +142,11 @@ public String getHead() { return pullRequest.getHead().getSha(); } + @Whitelisted + public String getHeadRef() { + return pullRequest.getHead().getRef(); + } + @Whitelisted public String getBase() { return pullRequest.getBase().getRef();