0.0.9 • Published 2 years ago

@infracost/compost v0.0.9

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

Compost

Compost is for tools that run in CI pipelines and want to post results as pull request/commit comments.

It currently detects the following CI environments:

  • GitHub Actions
  • GitLab CI
  • Azure DevOps
  • Azure DevOps (GitHub)

Coming soon:

  • BitBucket
  • Circle CI (GitHub)
  • CircleCI (BitBucket)

Install

npm install -g @infracost/compost

Examples

Detect the current CI environment and update the previously posted comment. If a previous comment hasn't been posted, then this creates a new comment:

compost autodetect update --body="my comment"

Post a new comment:

compost autodetect new --body="my new comment"

Delete the previous posted comments and post a new comment:

compost autodetect delete-and-new --body="my new comment"

Hide the previous posted comments and post a new comment (Note: Currently only supported for GitHub):

compost autodetect hide-and-new --body="my new comment"

Get the latest comment that was posted by compost

compost autodetect latest

Post a comment to a specific GitHub pull request:

compost github update infracost/compost-example pr 3 --body="my PR comment"

Post a comment to a specific GitHub commit SHA:

compost github update infracost/compost-example commit 2ca7182 --body="my commit comment"

Flags

Name                      Description
--bodySpecify the comment body content.
--body-fileSpecify a path to a file containing the comment body. Mutually exclusive with --body.
--tagCustomize the comment tag. This is added to the comment as a markdown comment to detect the previously posted comments.
--platformOptions: github, gitlab, azure-devops. Only supported by autodetect command. Limit the auto-detection to the specified platform.
--target-typeOptions: pull-request (pr), merge-request (mr), commit. Only supported by autodetect command. Limit the auto-detection to add the comment to either pull/merge requests or commits.
--dry-runSkips any comment posting, deleting or hiding.