diff --git a/_index.md b/content/_index.md similarity index 81% rename from _index.md rename to content/_index.md index 5af30f6..0c898a4 100644 --- a/_index.md +++ b/content/_index.md @@ -17,6 +17,29 @@ Drone plugin to add comments to GitHub Issues and Pull Requests. +## Usage + +```YAML +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-s3-sync.data >}} + + + ## Build Build the binary with the following command: @@ -36,7 +59,7 @@ Build the Docker image with the following command: docker build --file docker/Dockerfile.amd64 --tag thegeeklab/drone-github-comment . ``` -## Usage +## Test ```Shell docker run --rm \ @@ -50,23 +73,3 @@ docker run --rm \ -w $(pwd) \ thegeeklab/drone-github-comment ``` - -### Parameters - -api_key -: sets api key to access github api - -base_url -: sets api url; need to be changed for gh enterprise (default `https://api.github.com`) - -key -: sets unique key to assign to comment - -message -: sets file or string with comment message - -update -: enables update of an existing comment that matches the key - -skip_missing -: skips comment creation if the given message file does not exist (default `false`) diff --git a/data/data.yaml b/data/data.yaml new file mode 100644 index 0000000..66ac850 --- /dev/null +++ b/data/data.yaml @@ -0,0 +1,34 @@ +--- +properties: + api_key: + description: Personal Access token to access the GitHub API. + type: string + required: false + + base_url: + description: API URL. Only need to be changed for GitHub enterprise in most cases + defaultValue: https://api.github.com + type: string + required: false + + key: + description: Unique identifier to assign to a comment. The identifier is used to update an existing comment. + type: string + required: false + + message: + description: File or string that contains the comment text. + type: string + required: false + + update: + description: Enables update of an existing comment that matches the key. + defaultValue: false + type: bool + required: false + + skip_missing: + description: Skips comment creation if the given message file does not exist + defaultValue: false + type: bool + required: false