Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kota65535/github-terraform-plan-slack-action
GitHub Action for sending terraform plan result to a Slack channel.
https://github.com/kota65535/github-terraform-plan-slack-action
github-actions slack terraform
Last synced: 5 days ago
JSON representation
GitHub Action for sending terraform plan result to a Slack channel.
- Host: GitHub
- URL: https://github.com/kota65535/github-terraform-plan-slack-action
- Owner: kota65535
- License: mit
- Created: 2022-08-08T17:29:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T18:36:51.000Z (9 days ago)
- Last Synced: 2024-10-29T20:38:43.561Z (8 days ago)
- Topics: github-actions, slack, terraform
- Language: JavaScript
- Homepage:
- Size: 1.34 MB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-terraform-plan-slack-action
GitHub Action for sending terraform plan result to a Slack channel.
- Shows summary of the affected resources
- [Click here](https://github.com/kota65535/github-terraform-plan-slack-action/actions/runs/3838277394/jobs/6534545272#step:8:56)
link to easily jump to the full plan log![img.png](img.png)
## Inputs
| Name | Description | Required | Default |
|---------------------|-----------------------------------------------|----------|---------------------------------------------------------|
| `plan-job` | Job name where `terraform plan` has been run | Yes | N/A |
| `plan-step` | Step name where `terraform plan` has been run | Yes | N/A |
| `plan-index` | Index number if multiple plans have run | No | 0 |
| `workspace` | Terraform workspace name | No | N/A |
| `github-token` | GitHub token | No | `${{ env.GITHUB_TOKEN }}` or
`${{ github.token }}` |
| `channel` | Slack channel name | No (*1) | N/A |
| `slack-bot-token` | Slack bot token | No (*1) | `${{ env.SLACK_BOT_TOKEN }}` |
| `slack-webhook-url` | Slack webhook URL | No (*1) | `${{ env.SLACK_WEBHOOK_URL }}` |1. Need to specify `channel` and `slack-bot-token` both or `slack-webhook-url`.
## Outputs
| Name | Description |
|------------------|------------------------------------------------------------|
| `should-apply` | `true` if `terraform apply` is needed, otherwise `false` |
| `should-refresh` | `true` if `terraform refresh` is needed, otherwise `false` |## Usage
Use this action after the job where you run `terraform plan`.
```yaml
plan:
runs-on: ubuntu-latest
steps:
# ... other steps
- name: Run terraform plan
run: terraform planafter-plan:
runs-on: ubuntu-latest
needs:
- plan
steps:
- name: Notify terraform plan result to the Slack channel
uses: kota65535/github-terraform-plan-slack-action@v1
with:
plan-job: plan
plan-step: Run terraform plan
channel: my-ci
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
```