Skip to content

Commit

Permalink
Corrected ingestion triggers for failure notification (#260)
Browse files Browse the repository at this point in the history
* Corrected ingestion triggers for failure notification

* Corrected config for slack failure push notification

* Commented out workflow steps to test slack notification

* Reintroduced workflow steps commented for testing

* Update .github/workflows/ingest-cadet-metadata.yml
  • Loading branch information
murdo-moj committed Sep 6, 2024
1 parent d7f1b23 commit 2e59cfb
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/ingest-cadet-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,30 +74,20 @@ jobs:
run: time poetry run datahub ingest -c ingestion/create_cadet_databases.yaml

- name: push metadata to datahub
id: push_datahub
env:
DATAHUB_GMS_TOKEN: ${{ secrets.DATAHUB_GMS_TOKEN }}
DATAHUB_GMS_URL: ${{ vars.DATAHUB_GMS_URL }}
DATAHUB_TELEMETRY_ENABLED: false
run: time poetry run datahub ingest -c ingestion/cadet.yaml

- name: Notify on failure
uses: slackapi/slack-github-action@v1.26.0
if: job.status == 'failure'
uses: slackapi/slack-github-action@v1.27.0
if: failure()
with:
channel-id: "C071VNHPUHZ"
payload: |
{
"text": ":warning: Unable to ingest CaDeT metadata on ${{inputs.ENVIRONMENT}}!",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action run result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
"text": ":warning: ALERT: DataHub CaDeT metadata ingestion failure on ${{inputs.ENVIRONMENT}}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ALERT_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}

0 comments on commit 2e59cfb

Please sign in to comment.