-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace issue creation with slack alert
- Loading branch information
1 parent
34eef55
commit 82cb20c
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ jobs: | |
secret/data/products/infrastructure-experience/ci/common AWS_ACCESS_KEY; | ||
secret/data/products/infrastructure-experience/ci/common AWS_SECRET_KEY; | ||
secret/data/products/infrastructure-experience/ci/common RH_OPENSHIFT_TOKEN; | ||
secret/data/products/infrastructure-experience/ci/common SLACK_BOT_TOKEN; | ||
# Official action does not support profiles | ||
- name: Add profile credentials to ~/.aws/credentials | ||
|
@@ -91,7 +92,6 @@ jobs: | |
fi | ||
- name: Create issue on failure | ||
if: failure() | ||
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -101,3 +101,26 @@ jobs: | |
update_existing: true | ||
search_existing: open | ||
filename: .github/templates/issue_delete_clusters_failed.md | ||
|
||
|
||
- name: Notify in Slack in case of failure | ||
id: slack-notification | ||
# if: failure() | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: 'C05S0M7KG6A' # infex-internal | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":automation-platform-failure: :mechanic: [${{ github.event.repository.name }}] scheduled workflow: ${{ github.workflow }} failed! \n :link: Please check: ${{ env.WORKFLOW_URL }}" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ steps.secrets.outputs.SLACK_BOT_TOKEN }} | ||
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" |