Skip to content

A lightweight script that posts content read from stdin as a GitHub comment.

Notifications You must be signed in to change notification settings

naseemkullah/post-github-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

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

About

A lightweight script that posts content read from stdin as a GitHub comment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published