Skip to content

Commit

Permalink
fix: use gha
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Jun 5, 2024
1 parent 21120b5 commit d65afe6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 21 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/daily-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ 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 All @@ -77,24 +76,9 @@ jobs:

- name: Notify in Slack in case of failure
id: slack-notification
# if: failure()
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
# if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@feature/report-failure-action # TODO: change me to main when available
with:
channel-id: 'C05S0M7KG6A' # infex-internal
payload: |
{
"blocks": [
{
"type": "section",
"unfurl_links": false,
"unfurl_media": false,
"text": {
"type": "mrkdwn",
"text": ":automation-platform-failure: :mechanic: <${{ github.server_url }}/${{ github.repository }}|[${{ github.event.repository.name }}]> scheduled workflow: ${{ github.workflow }} failed! \n :link: Please check: ${{ env.WORKFLOW_URL }} \n (cc @infraex-medic)"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ steps.secrets.outputs.SLACK_BOT_TOKEN }}
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
vault_addr: ${{ secrets.VAULT_ADDR }}
vault_role_id: ${{ secrets.VAULT_ROLE_ID }}
vault_secret_id: ${{ secrets.VAULT_SECRET_ID }}
13 changes: 13 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
pull_request_target:
schedule:
- cron: "0 1 * * 1"
pull_request:
paths:
- .github/workflows/labeler.yml

jobs:
labeler:
permissions:
Expand All @@ -11,3 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5

- name: Notify in Slack in case of failure
id: slack-notification
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@feature/report-failure-action # TODO: change me to main when available
with:
vault_addr: ${{ secrets.VAULT_ADDR }}
vault_role_id: ${{ secrets.VAULT_ROLE_ID }}
vault_secret_id: ${{ secrets.VAULT_SECRET_ID }}
9 changes: 9 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ jobs:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: report, automated issue

- name: Notify in Slack in case of failure
id: slack-notification
if: ${{ github.event_name == 'schedule' && env.lychee_exit_code != 0 }}
uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@feature/report-failure-action # TODO: change me to main when available
with:
vault_addr: ${{ secrets.VAULT_ADDR }}
vault_role_id: ${{ secrets.VAULT_ROLE_ID }}
vault_secret_id: ${{ secrets.VAULT_SECRET_ID }}
9 changes: 9 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,12 @@ jobs:
cluster-name: "${{ steps.commit_info.outputs.cluster_name }}"
aws-region: ${{ env.TESTS_AWS_REGION }}
s3-backend-bucket: ${{ env.TF_S3_BUCKET }}

- name: Notify in Slack in case of failure
id: slack-notification
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@feature/report-failure-action # TODO: change me to main when available
with:
vault_addr: ${{ secrets.VAULT_ADDR }}
vault_role_id: ${{ secrets.VAULT_ROLE_ID }}
vault_secret_id: ${{ secrets.VAULT_SECRET_ID }}

0 comments on commit d65afe6

Please sign in to comment.