Skip to content

chore: modify surge alert to prevent false alarms and fix name #157

chore: modify surge alert to prevent false alarms and fix name

chore: modify surge alert to prevent false alarms and fix name #157

Workflow file for this run

name: Provision Sysdig Configuration via Terraform
on:
push:
branches:
- main
paths:
- "terraform/**"
- ".github/**"
pull_request:
paths:
- "terraform/**"
- ".github/**"
env:
TF_VERSION: 1.1.8
jobs:
terraform:
runs-on: ubuntu-20.04
steps:
- uses: hmarr/debug-action@v3
- uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: Terraform Format
id: fmt
run: terraform fmt -check
working-directory: ./terraform
- name: Terraform Variables
run: |
cat >"config.tf" <<EOF
terraform {
backend "s3" {
bucket = "xgr00q-prod-sysdig"
key = "sysdig"
region = "ca-central-1"
access_key = "${{ secrets.TF_ACCESS_KEY }}"
secret_key = "${{ secrets.TF_SECRET_KEY }}"
role_arn = "${{ secrets.TF_ROLE_ARN }}"
}
}
EOF
cat >"ci.auto.tfvars" <<EOF
gold_c6af30_team_sysdig_monitor_api_token="${{ secrets.GOLD_C6AF30_TEAM_SYSDIG_MONITOR_API_TOKEN }}"
gold_eb75ad_team_sysdig_monitor_api_token="${{ secrets.GOLD_EB75AD_TEAM_SYSDIG_MONITOR_API_TOKEN }}"
gold_e4ca1d_team_sysdig_monitor_api_token="${{ secrets.GOLD_E4CA1D_TEAM_SYSDIG_MONITOR_API_TOKEN }}"
EOF
working-directory: ./terraform
- name: Terraform Init
id: init
run: terraform init -upgrade
working-directory: ./terraform
- name: Terraform Plan
id: plan
if: github.event_name == 'pull_request'
run: terraform plan -no-color
working-directory: ./terraform
continue-on-error: true
# - uses: actions/github-script@v7
# if: github.event_name == 'pull_request'
# env:
# PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# script: |
# const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
# #### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
# #### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
# <details><summary>Show Plan</summary>
# \`\`\`${process.env.PLAN}\`\`\`
# </details>
# *Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
# github.rest.issues.createComment({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# body: output
# })
- name: Terraform Plan Status
if: steps.plan.outcome == 'failure'
run: exit 1
- name: Terraform Apply
if: github.event_name == 'push'
run: terraform apply -auto-approve
working-directory: ./terraform