0
0
mirror of https://github.com/thegeeklab/wp-github-comment.git synced 2024-11-13 23:10:40 +00:00
wp-github-comment/_docs/content/_index.md
2023-08-17 15:12:59 +02:00

2.8 KiB

title
wp-github-comment

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

Woodpecker CI plugin to add comments to GitHub Issues and Pull Requests.

{{< toc >}}

Usage

{{< hint type=important >}} Due to the nature of this plugin, a secret for the GitHub token may need to be exposed for pull request events in Woodpecker. Please be careful with this option, as a malicious actor may submit a pull request that exposes your secrets. Do not disclose secrets to pull requests in public environments without further protection. {{< /hint >}}

{{< 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/wp-github-comment
    settings:
      api_key: ghp_3LbMg9Kncpdkhjp3bh3dMnKNXLjVMTsXk4sM
      message: "CI run completed successfully"
      update: true

Parameters

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

Build

Build the binary with the following command:

make build

Build the container image with the following command:

docker build --file Containerfile.multiarch --tag thegeeklab/wp-github-comment .

Test

docker run --rm \
  -e CI_PIPELINE_EVENT=pull_request \
  -e CI_REPO_OWNER=octocat \
  -e CI_REPO_NAME=foo \
  -e CI_COMMIT_PULL_REQUEST=1
  -e PLUGIN_API_KEY=abc123 \
  -e PLUGIN_MESSAGE="Demo comment" \
  -v $(pwd):/build:z \
  -w /build \
  thegeeklab/wp-github-comment