Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.08 KB

README.md

File metadata and controls

35 lines (26 loc) · 1.08 KB

post-github-comment

post-github-comment posts content read from stdin as a GitHub comment.

How it works

post-github-comment does not import any dependencies, as such, it runs easily in CI/CD systems using a node docker image.

The following environment variables are required:

  • GITHUB_OWNER
  • GITHUB_REPO
  • GITHUB_PULL_NUMBER
  • GITHUB_TOKEN

For more info, please refer to GitHub's documentation.

Example Usage

The following snippet shows how post-github-comment can be used to post the contents of a previously generated file called diff.yaml in Google Cloud Build pull request checks.

  - name: "node:lts-slim"
    id: "post-github-comment"
    entrypoint: "bash"
    args:
      - "-c"
      - |
        cat \
          <(echo Contents of diff:) \
          <(echo \`\`\`diff) \
          diff.yaml \
          <(echo \`\`\`) |
          ./post-github-comment.js