Skip to content

Commit

Permalink
Move failure notif to step for more information
Browse files Browse the repository at this point in the history
  • Loading branch information
ayellapragada committed Apr 11, 2024
1 parent 8980173 commit d0c463c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 25 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ permissions:
checks: write

jobs:
fail_test:
runs-on: ubuntu-20.04
steps:
- name: Fail Test
run: exit 1

apply_network:
name: Apply Network
uses: ./.github/workflows/terraform.yaml
Expand Down Expand Up @@ -114,22 +108,3 @@ jobs:
terraform_command: destroy
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}

notify_slack:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- name: Notify Slack
if: failure()
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
continue-on-error: true
with:
channel-id: '#mission-control'
payload: |
{
"text": "TEST_MESSAGE, IGNORE - 'Flightdeck acceptance tests have failed.'",
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
description: AWS account in which Terraform will run
required: true

env:
# SLACK_CHANNEL: '#mission-control'
SLACK_CHANNEL: '#testing-please-ignore'

jobs:
plan:
name: Terraform
Expand Down Expand Up @@ -92,3 +96,15 @@ jobs:
run: |
terraform ${{ inputs.terraform_command }} -auto-approve
- name: Notify Slack
if: failure()
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
continue-on-error: true
with:
channel-id: ${{ env.SLACK_CHANNEL }}
payload: |
{
"text": "TEST_MESSAGE, IGNORE - 'Flightdeck acceptance tests have failed on terraform steps. Module: ${{ inputs.module }}, with command: ${{ inputs.command}}'",
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
15 changes: 15 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:

env:
KUBECONFIG: /tmp/kubeconfig
# SLACK_CHANNEL: '#mission-control'
SLACK_CHANNEL: '#testing-please-ignore'

jobs:
plan:
Expand Down Expand Up @@ -68,3 +70,16 @@ jobs:
make tests \
ADDRESS=https://${{ github.ref_name }}.flightdeck-test.thoughtbot.com \
CLUSTER="$CLUSTER"
- name: Notify Slack
if: failure()
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
continue-on-error: true
with:
channel-id: ${{ env.SLACK_CHANNEL }}
payload: |
{
"text": "TEST_MESSAGE, IGNORE - 'Flightdeck acceptance tests have failed on the cluster.'",
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit d0c463c

Please sign in to comment.