drone-github-comment/_docs/content/_index.md

2.2 KiB

title
drone-github-comment

Build Status Docker Hub Quay.io GitHub contributors Source: GitHub License: MIT

Drone plugin to add comments to GitHub Issues and Pull Requests.

{{< toc >}}

Usage

kind: pipeline
name: default

steps:
  - name: pr-comment
    image: thegeeklab/drone-github-comment
    settings:
      api_key: ghp_3LbMg9Kncpdkhjp3bh3dMnKNXLjVMTsXk4sM
      message: "CI run completed successfully"
      update: true

Parameters

{{< propertylist name=drone-github-comment.data >}}

Build

Build the binary with the following command:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

make build

Build the Docker image with the following command:

docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-github-comment .

Test

docker run --rm \
  -e DRONE_BUILD_EVENT=pull_request \
  -e DRONE_REPO_OWNER=octocat \
  -e DRONE_REPO_NAME=foo \
  -e DRONE_PULL_REQUEST=1
  -e PLUGIN_API_KEY=abc123 \
  -e PLUGIN_MESSAGE="Demo comment" \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  thegeeklab/drone-github-comment