Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/infracost/compost
Post pull request comments from multiple CI platforms
https://github.com/infracost/compost
azure-devops ci comments github gitlab pull-requests
Last synced: 8 days ago
JSON representation
Post pull request comments from multiple CI platforms
- Host: GitHub
- URL: https://github.com/infracost/compost
- Owner: infracost
- License: apache-2.0
- Created: 2021-11-10T21:33:51.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T17:38:47.000Z (over 1 year ago)
- Last Synced: 2024-04-24T21:00:42.349Z (7 months ago)
- Topics: azure-devops, ci, comments, github, gitlab, pull-requests
- Language: TypeScript
- Homepage:
- Size: 1.2 MB
- Stars: 29
- Watchers: 6
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Compost
## Deprecation notice
⚠️ This repo is now deprecated. We have moved this functionality into the Infracost CLI via the `infracost comment` subcommand. See [the infracost comment docs](https://www.infracost.io/docs/features/cli_commands/#comment-on-pull-requests) for usage. ⚠️
---
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
```sh
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:
```sh
compost autodetect update --body="my comment"
```Post a new comment:
```sh
compost autodetect new --body="my new comment"
```Delete the previous posted comments and post a new comment:
```sh
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):
```sh
compost autodetect hide-and-new --body="my new comment"
```Get the latest comment that was posted by compost
```sh
compost autodetect latest
```Post a comment to a specific GitHub pull request:
```sh
compost github update infracost/compost-example pr 3 --body="my PR comment"
```Post a comment to a specific GitHub commit SHA:
```sh
compost github update infracost/compost-example commit 2ca7182 --body="my commit comment"
```## Flags
| Name | Description |
|-|-|
| `--body` | Specify the comment body content. |
| `--body-file` | Specify a path to a file containing the comment body. Mutually exclusive with `--body`. |
| `--tag` | Customize the comment tag. This is added to the comment as a markdown comment to detect the previously posted comments. |
| `--platform` | Options: `github`, `gitlab`, `azure-devops`. Only supported by `autodetect` command. Limit the auto-detection to the specified platform. |
| `--target-type` | Options: `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-run` | Skips any comment posting, deleting or hiding. |