# githubPostPrComment

This step posts a comment to a Github pull request.

## Parameters

| Name          | Description                 | Type     | Default         | Required |
| ------------- | --------------------------- | -------- | --------------- | -------- |
| message       | The contents of the comment | `String` | n/a             | yes      |
| repo          | The Github repository name  | `String` | n/a             | yes      |
| owner         | The Github repository owner | `String` | 'theorchard'    | no       |
| pullRequestId | Id of the pull request      | `String` | `env.CHANGE_ID` | no       |

## Usage

Note that the pull request ID is automatically picked up using the the `env.CHANGE_ID` variable. And the `env.CHANGE_ID` variable is only available for runs triggered by a pull request.
If running the step in a non PR branch, you need to provide the `pullRequestId` parameter.

### Post a comment on stage success

```groovy
stage('Some PR task') {
    steps {
        performSomeTask()
    }
    post {
        success {
            githubPostPrComment(
                repo: 'frontend-test',
                message: '🚀 Task is done!'
            )
        }
    }
}
```
