Skip to content

Commit

Permalink
feat: replace issue creation with slack alert
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Jun 5, 2024
1 parent 34eef55 commit 82cb20c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/actions/rosa-create-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ runs:
shell: bash
retry_wait_seconds: 15
command: |
: # see https://github.com/nick-fields/retry/issues/133
set -o errexit
set -o pipefail
oc login --username "${{ inputs.admin-username }}" --password "${{ inputs.admin-password }}" "${{ steps.cluster_info.outputs.cluster_api }}"
rosa grant user cluster-admin --cluster="${{ inputs.cluster-name }}" --user="${{ inputs.admin-username }}" --region="${{ inputs.aws-region }}"
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/daily-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}"

0 comments on commit 82cb20c

Please sign in to comment.