mirror of
https://github.com/thegeeklab/drone-github-comment.git
synced 2024-11-16 08:00:39 +00:00
2.4 KiB
2.4 KiB
title |
---|
drone-github-comment |
Drone plugin to add comments to GitHub Issues and Pull Requests.
{{< toc >}}
Usage
{{< hint type=note >}} Only pull request events are supported by this plugin. Running the plugin on other events will result in an error. {{< /hint >}}
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 sort=name >}}
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