Skip to content

Commit

Permalink
chore: update links (#676)
Browse files Browse the repository at this point in the history
* chore: update links

* docs: add permission details
  • Loading branch information
alikhajeh1 authored Oct 23, 2024
1 parent edb9e78 commit 45b7dd8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/infracost_cloud/guardrails.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Next you should select the thresholds that should trigger this guardrail, the th

### 4. Notifications to send

You can select the users who should be emailed when a guardrail is triggered. You can also create a [Slack channel webhook](https://slack.com/intl/en-tr/help/articles/115005265063-Incoming-webhooks-for-Slack) and use that for notifications.
You can select the users who should be emailed when a guardrail is triggered. You can also create a [Slack channel webhook](https://api.slack.com/messaging/webhooks) and use that for notifications.

We recommend enabling the pull request option, so engineers are shown the guardrail information in the Infracost pull request comment too. Regardless of which notification option you select, you can set a custom message to be included in them to give additional context or instructions. For example, you can describe why this guardrail is important or what will happen next after someone has reviewed the notification.

Expand Down
21 changes: 21 additions & 0 deletions docs/integrations/github_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,27 @@ The [Infracost GitHub App](https://github.com/marketplace/infracost) is verified

The app needs *read access to code repos* so it can run the CLI against them, and *write access to pull requests* so it can post a comment with policy issues and cost estimates. You can select the repos you would like to give access to the App.

<details>
<summary>Details of required permissions</summary>

The Infracost GitHub App requires the following permissions.

- **Read-only** access is needed for the following so Infracost gets notified of repo or pull request changes and can process the code:
- Metadata (Search repositories, list collaborators, and access repository metadata)
- Contents (Repository contents, commits, branches, downloads, releases, and merges)
- Actions (Workflows, workflow runs and artifacts)
- Deployments (Deployments and deployment statuses)
- Issues (Issues and related comments, assignees, labels, and milestones)
- Administration (Repository creation, deletion, settings, teams, and collaborators)
- Members (Organization members and teams)
- **Read and write** access is needed for the following so Infracost can post pull request comments and update statuses in GitHub:
- Pull requests (Pull requests and related comments, assignees, labels, milestones, and merges)
- Checks (checks on code)
- Commit statuses
- Webhooks (Manage the post-receive hooks for a repository)

</details>

Each time a pull request is opened or a new commit is pushed to open pull requests, the Infracost GitHub App shows the cost difference between the most recent commit of the pull request branch, and the merge base of the base branch. The merge base is the latest common commit of the pull request base and target branch. This mirrors GitHub's pull request diff logic and shows only the cost of 'what a pull request introduces'.

The GitHub App automatically reflects the following changes in Infracost:
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';

Infracost Cloud [Guardrails](/docs/infracost_cloud/guardrails/) have native support for Slack notifications that trigger when your defined thresholds are exceeded. If you are not using that feature, you can post cost estimates to Slack by following these steps in your CI/CD system:

1. Create a [Slack Webhook](https://slack.com/intl/en-tr/help/articles/115005265063-Incoming-webhooks-for-Slack) in your workspace.
1. Create a [Slack Webhook](https://api.slack.com/messaging/webhooks) in your workspace.
2. Use the `infracost output --format slack-message` [command](/docs/features/cli_commands/) to produce a Slack-flavored Markdown message. Slack message blocks have a 3000 char limit so the Infracost CLI automatically truncates the middle of the `slack-message` output format if required.
3. Post the message to Slack using `curl` from your CI/CD system. See [this example](https://gitlab.com/infracost/infracost-gitlab-ci/-/tree/master/examples/slack) for how to do this in GitLab, the same bash commands can be used in other systems.

Expand Down

0 comments on commit 45b7dd8

Please sign in to comment.